Wednesday, February 25, 2015

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

Question:What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used??

Answer: </I>The strcpy() function is designed to work exclusively with strings. It copies each byte of the source string to the destination string and stops when the terminating <I>null character </I>(�) has been moved. On the other hand, the memcpy() function is designed to work with any type of data. Because not all data ends with a null character, you must provide the memcpy() function with the number of bytes you want to copy from the source to the destination. &nbsp;

Tags:Interview Questions, Languages, C,

Please submit your Interview Answer for the above Question via replying to this post. Thank you for visiting to our blog, Have a Good Day!.



Sponsor Advertisement



Hospital Management Software

Hotel Management System Software

Hotel Management System software is a web based system help to manage reservations, roomstays, bookings, guests, folios, invoices and billing etc. The software features include revenue management, booking calendar, guest relationship management, check-in & check-out, invoices and receipts etc...

No comments:

Post a Comment