C Pointers Question:
Download Job Interview Questions and Answers PDF
What is the difference between strcpy() and memcpy() function?
Answer:
The following are the differences between strcpy() and memcpy():
- memcpy() copies specific number of bytes from source to destinatio in RAM, where as strcpy() copies a constant / string into another string.
- memcpy() works on fixed length of arbitrary data, where as strcpy() works on null-terminated strings and it has no length limitations.
- memcpy() is used to copy the exact amount of data, whereas strcpy() is used of copy variable-length null terminated strings.
- memcpy() copies specific number of bytes from source to destinatio in RAM, where as strcpy() copies a constant / string into another string.
- memcpy() works on fixed length of arbitrary data, where as strcpy() works on null-terminated strings and it has no length limitations.
- memcpy() is used to copy the exact amount of data, whereas strcpy() is used of copy variable-length null terminated strings.
Download C Pointers Interview Questions And Answers
PDF
Previous Question | Next Question |
Explain what is the purpose of "extern" keyword in a function declaration? | Explain #pragma statements? |