CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C DETAILS
Question :
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Category C Interview Questions
Rating (4.4) By 7 users
Added on 10/22/2004
Views 5695
Rate it!
Answers:

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 null character () 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.





If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
How can I convert a number to a string?
View Answer
How can I convert a string to a number?
View Answer
How do you print only part of a string?
View Answer
What is indirection?
View Answer
How many levels of pointers can you have?
View Answer
What is a null pointer?
View Answer
What is a void pointer?
View Answer
Is NULL always defined as 0?
View Answer
What does it mean when a pointer is used in an if statement?
View Answer
Can you add pointers together? Why would you?
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/1015/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.59