Ah, I thought strdup() was a C standard function - turns out it's a POSIX/BSD function. You can easily implement it with something like:
#include <stdlib.h>
#include <string.h>
char...
Type: Posts; User: JohnGraham
Ah, I thought strdup() was a C standard function - turns out it's a POSIX/BSD function. You can easily implement it with something like:
#include <stdlib.h>
#include <string.h>
char...
I'm surprised that doesn't segfault... you'll be stuffing however many characters you get into `name', which is a variable that can hold a single char... bound to be bad. Also, strcpy() won't work,...