adspace


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

Answer Posted / Ambesh Hemkar

"The strcpy() function copies a string from the source to a destination, including the null character (). In contrast, memcpy() is used for copying arbitrary blocks of memory. Strcpy() converts the source string into a character array (char*), while memcpy() operates on raw memory (void*). They should be used depending on whether you are dealing with strings or generic data."

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a c program to find the sum of five entered numbers using an array named number

2265


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

1307


write a progrmm in c language take user interface generate table using for loop?

2129


What is variable initialization and why is it important?

1404


i have a written test for microland please give me test pattern

2816


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2522


What is pointer to pointer in c with example?

1205


In C programming, how do you insert quote characters (‘ and “) into the output screen?

1625


hi send me sample aptitude papers of cts?

2258


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

2269


will u please send me the placement papers to my mail???????????????????

1939


What is the difference between union and anonymous union?

1413


How can I implement sets or arrays of bits?

1129


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2743


Do you know the difference between malloc() and calloc() function?

1144