memcpy
i an pretty new to c/c++ and even thought i am in the beginners
forum this question is pretty stupid but the to books i have on programing C/C++ and game pgrgraming for dummys do not explane
this function memcpy how dose it copy or pack the data into the first argument
virtual what
It copies count characters from the src array into the dest array.
Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
void memcpy( void* dest, const void* src, size_t count ){ while( count-- ) *((char*)dest++) = *((const char*)src++);};
Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Furthermore, the caller of memcpy has the responsibility to ensure the source and destination ranges do not overlap, else the behaviour is undefined. If you are programming in C++, and you are using objects, you really should avoid memcpy, as it doesn''t play nicely with objects.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement