is there platform-independent FillMemory function in C/C++!?
-
Hi! I'm looking for some platform-independent C/C++ function which would be to pre-fill a large memory area with some value, just like FillMemory in win32 does. Does such a function exist, or do I have to make my own in assembly?
-
Hi! I'm looking for some platform-independent C/C++ function which would be to pre-fill a large memory area with some value, just like FillMemory in win32 does. Does such a function exist, or do I have to make my own in assembly?
-
Have you looked at memset ? __________________________________________ a two cent stamp short of going postal.
-
Have you looked at memset ? __________________________________________ a two cent stamp short of going postal.
-
Is it elegant to use 'memset' in a full C++ environment? It is all the rage in C++ parties lately :) Seriously now, its usage is just fine, and, unlike
FillMemory
, it is platform-independent, which is what you were looking for. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo Want a Boost forum in Code Project? Vote here[^]! -
and, of course, is there any way to put not bytes but ints (4bytes) after each other? cause memset seems suitable only for single bytes...
There is no low-level function to do this that I know of. You'd have to resort to a manual loop or some STL algorithm like
std::fill
. The difference is thatmemset
is probably optimized for the particular HW targeted by the compiler, and so much faster. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo Want a Boost forum in Code Project? Vote here[^]!