4 ms·
> This semester I used function pointers in an assignment and later heard them described as “Quinn’s magic C voodoo”. I still think I have to polish up on 'em:
by NAFV_P 13y ago
> This semester I used function pointers in an assignment and later heard them described as “Quinn’s magic C voodoo”.
I still think I have to polish up on 'em:
#include <stdio.h>
#include <ctype.h>
//
int chk_arg(char *s, int (*f)(int)) {
while(*s)
if(!(f(*s)))
return 1;
else
++s;
return 0;
}
//
char *s[]= { "1048leet576", "numbers only pls\n" };
if(chk_arg(*s, isdigit))
printf(*(s+1));
> This was confusing - my classmates were juniors and seniors who were 3+ years into a computer science degree, yet many of them didn’t seem to have an understanding of how computers worked. They could write high-level code and analyze algorithms, but had never used malloc.
What the hell, CS students who haven't used malloc? I've got no formal background in CS, yesterday I wrote a binary search tree in C that passed valgrind.
- moccajoghurt 13y agoI am positive that 95% of the CS students with a BSc. degree in my college haven't even seen function pointers. We learn the basics of C then OOP in C++ and the rest of the study will be Java. It's a farce and as an employer I wouldn't even care whether my employee has a fancy degree. You won't find real coders if you choose them by their degree. At least in Germany it's like that. I am not sure of it's different in other countries.
- NAFV_P 13y ago> At least in Germany it's like that. I am not sure of it's different in other countries. I get the impression it is the same situation in the UK. It's nice knowing I can do a dozen rounds with a CS graduate.
- pjmlp 13y agoI am a Portuguese living in Germany and every time someone describes me how CS degrees work here, I always feel sorry for my work colleagues. When I took my degree in Portugal in the mid-90's, it was a 5 year long degree, with heavy mix of theory and practical subjects in lots of programming languages. I got to use C, C++, Prolog, Camllight, Java, PL/I, Algol, Pascal as compulsory ones. Plus many many others that I got to learn/use as part of the compiler design lectures I used to attend to. All CS areas had introductory levels as compulsory, with the more advanced ones as optional subjects. Given the way the credits were set up, quite a few of those advanced ones were also required.