0 votes
in C Plus Plus by
Difference between strdup and strcpy in C Language?

1 Answer

0 votes
by
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 .

Related questions

0 votes
asked Mar 10, 2020 in C Plus Plus by rahuljain1
0 votes
asked Jan 6 in C Plus Plus by GeorgeBell
...