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.