What is the difference between strcpy() and memcpy() function?
Submitted by: AdministratorThe 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.
Submitted by: Administrator
- 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.
Submitted by: Administrator
Read Online C Pointers Job Interview Questions And Answers
Top C Pointers Questions
☺ | What would be the equivalent pointer expression for referring the array element a[i][j][k][l] |
☺ | Tell me with an example the self-referential structure? |
☺ | Explain what is the purpose of "extern" keyword in a function declaration? |
☺ | What is the difference between exit() and _exit() function? |
☺ | Do you know the use of fflush() function? |
Top C Programming Categories
☺ | C Functions Interview Questions. |
☺ | C Pointers Interview Questions. |
☺ | C Preprocessor Interview Questions. |