if i use memset i can only give 1 number as parameter. and if i manually do it with a loop it takes to long(I end up looping 19200 times). so i was wondering, is there a better way to accomplish this?
1. memset the first three bytes
2. memcpy 3 bytes to next 3 bytes
3. memcpy 6 bytes to next 6 bytes
4. memcpy 12 bytes to next 12 bytes
...
N-1. memcpy X bytes to next X bytes
N. memcpy Y bytes to last Y bytes
Line 6 was indeed incorrect. Should have been dest, not src.
Whether a smear move will work is platform dependent since it depends on the presence of an underlying hardware move instruction that moves byte by byte.
When I tried this on VS2010, it did not work. VS2010 moved bytes 0-2 to bytes 3-5, but the remaining bytes of the array were garbage.