Afficher un message
Vieux 06/02/2008, 16h45   #3
Greg Comeau
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Replacement for memcpy call in C++

In article <acd73157-9d82-46e2-8d50-8a731a0e6fd9@c23g2000hsa.googlegroups.com>,
mthread <rjkumr@gmail.com> wrote:
> I am copying data from one buffer(this data is a binary data not
>string) to another buffer. Earlier when I used C, I used the memcpy
>function call to copy the values. Is there any equivalent replacement
>in C++ for this call.


The direct answer is that memcpy is probably the best memcpy
provided, and you can get at it with C++ too (via string.h, or
cstring as std::memcpy). The indirect answer is that you may want
to change how you are doing your buffering, perhaps with
a std::string or std::vector, etc and use their respective copying.
--
Greg Comeau / 4.3.9 with C++0xisms now in beta!
Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
  Réponse avec citation
 
Page generated in 0,05054 seconds with 9 queries