IT Community - Software Programming, Web Development and Technical Support

string copy (strcpy) and a memory copy (memcpy)

This is a discussion on string copy (strcpy) and a memory copy (memcpy) within the C and C++ Programming forums, part of the Software Development category; Hi Guys can you brief about What is the difference between a string copy (strcpy) and a memory copy (memcpy)? ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-18-2007, 04:39 AM
vigneshgets vigneshgets is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 904
vigneshgets is on a distinguished road
Wink string copy (strcpy) and a memory copy (memcpy)

Hi Guys can you brief about What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-30-2007, 11:40 AM
shanmugamit shanmugamit is offline
D-Web Trainee
 
Join Date: Mar 2007
Posts: 10
shanmugamit is on a distinguished road
Default Re: string copy (strcpy) and a memory copy (memcpy)

hi,
strcpy() works on null-terminated strings, and has no length limitations;
memcpy() works on arbitrary data of a given fixed length... Aside from that, they
both preform the same basic function: shifting data around in memory... But, you
use memcpy() when you want to copy an exact amount of data (possibly containing
embedded null chars) from one location to another, and strcpy() when you want to
copy a variable-length null-terminated C string from one location to another...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy information from $_SESSION when timeout.? saravanan PHP Programming 0 03-19-2008 09:24 PM
copy information from HttpSession when timeout.? saravanan Java Server Pages (JSP) 0 03-19-2008 09:22 PM
disable COPY/Paste function on a textbox oxygen C# Programming 10 11-22-2007 04:45 AM
How can I copy just just the letters and only one of each from one form field to anot itbarota HTML, CSS and Javascript Coding Techniques 1 10-29-2007 08:19 AM
Copy-Write issues simplesabita Software Testing 1 09-06-2007 12:50 AM


All times are GMT -7. The time now is 07:25 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0