Adding a byte to a string
I am playing around with a plugin sdk for a video editor (Wax), and the code is:
Code:
memset(psImage->psImageData, 0x80, sizeof(ImageSample)*psImage->dwWidth*psImage->dwHeight);
My understanding of memset is that it replaces the old information with the second argument, for as many times as you specify in the third argument.
The resulting string(i dont think its actually a string, but I don't know what to call it) is information for an image, with four bytes to each pixel (r, g, b, alpha). sizeof(ImageSample) = 4.
I want to be able to have a loop and put my own colour. So I need to be able to append four bytes at a time. The for loop looks like this:
Code:
for(count = 0; count < psImage->dwWidth*psImage->dwHeight){
}
But I don't know what to put inside the loop.
What I think I need is a command that appends a byte to a string or in this case binary information. Thanks.