in C Plus Plus by
Q:
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 .
Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

0 votes
asked Mar 10, 2020 in C Plus Plus by rahuljain1
0 votes
asked Jun 11, 2020 in C Plus Plus by Robindeniel
0 votes
asked Mar 10, 2020 in C Plus Plus by rahuljain1
+1 vote
asked May 16, 2019 in C Plus Plus by tiger
0 votes
asked Mar 17, 2020 in C Plus Plus by SakshiSharma
...