Difference between strcpy() and memcpy() function?



Difference between strcpy() and memcpy() function?..

Answer / Chandra Kant Pandey

strcpy() is a string copying function in C that copies the contents of one string (source) into another (destination), null-terminating the destination string. It also takes care of handling the null byte. On the other hand, memcpy() is a generic memory copying function that can be used to copy any type of data. It does not handle null bytes or add a null byte at the end. This means you must ensure proper handling if using memcpy() with strings.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

wap in c to accept n number display the highest and lowest value

2 Answers  


Hai why 'c' is the middle language

4 Answers  


ratio,age,persentage

0 Answers  


write a c program to find largest of three numbers using simple if only for one time.

1 Answers  


What are the advantages and disadvantages of a heap?

1 Answers  


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

1 Answers  


Why is c used in embedded systems?

1 Answers  


When was c language developed?

1 Answers  


What is use of pointer?

1 Answers  


What is unary operator?

1 Answers  


what does static variable mean?

1 Answers   TCS,


Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

1 Answers  


Categories