Difference between strdup and strcpy?
Question :
Difference between strdup and strcpy?
Both copy a string. strcpy wants a buffer to copy into. strdup allocates a buffer using malloc().
Unlike strcpy(), strdup() is not specified by ANSI .
Difference between strdup and strcpy?
Difference between strdup and strcpy?
Both copy a string. strcpy wants a buffer to copy into. strdup allocates a buffer using malloc().
Unlike strcpy(), strdup() is not specified by ANSI .