Say I have manually allocated a large portion of memory in C++, say 10 MB.
Say for the heck of it I want to store a few bits around the middle of this region.
How would I get at the memory at that location?
The only way I know of accessing raw memory is using array notation.
Array notation is just another way of writing pointers. You can use that, or use pointers directly like so:
memcpy,memzero,memmove,memcmpand others may also be very useful, like this:Of course this code is also the same:
And so is this:
Also, one is not safer then the other, they are completely equivalent.