char *strcat(), *strcpy(), *fgets();

Doug Gwyn gwyn at brl-smoke.ARPA
Fri Jun 24 21:56:55 AEST 1988


In article <2030 at pt.cs.cmu.edu> jgm at k.gp.cs.cmu.edu (John Myers) writes:
>#define SAVESTR(s) (strcpy(malloc(strlen(s)+1),(s)))

Most of us call this function strdup(), and we test for NULL before
proceeding (since malloc() can fail).



More information about the Comp.std.c mailing list