when to use strncpy or memmove
- by robUK
Hello,
gcc 4.4.4 c89
I have always used strncpy to copy strings. I have never really used memmove or memcpy very much. However, I am just wondering when would you decide whether to use strncpy, memmove, or memcpy?
The code I am writing is for a client/server application. In the documentation they use bcopy. However, could I do the same with the others?
bcopy((char*)server->h_addr,
(char*)&serv_addr.sin_addr.s_addr,
server->h_length);
Many thanks,