> on these sample the 'NewColor' is 'RGB(0,255,0)'...
¿how do you represent that with only one byte?
man wrote:
void *memset(void *s, int c, size_t n);
The memset() function fills the first n bytes of the memory area pointed to by s with the constant byte c.
also, keep in mind that the function will fill the array byte by byte (it seems that you are storing integers, which may be a little bigger than one byte)
1st i'm sorry something.. nothing was in vain... i'm learning what i can for what i need.. .sorry something.
"Dude, you've been posting here for more than nine years. How is it possible you're writing code like this after using C++ for so long?"
i'm sorry, but what you mean?
memset is a crude tool.
but I think your issue is that it tells you the second parameter is an int. OK, it is, but its 0-255. You can't use it with an RGB.
like if you want a black image:
memset(pixels, 0, height*width*rgb_is_3_or_rgba_is_4_etc);
or a white image.. (pixels, 255,
or a sickly grey: (pixels, 128,
and so on. Most of the time with images those 3 constants are all you want.
all the mem*** family functions came from C and are a wee bit dangerous. Like serialization, they can't handle internal pointers in objects, and like anything C about arrays/pointers you can go out of bounds and all. I would avoid it unless you need the extra speed, they are fast, if nothing else.
As for your code, you are trying to deal with microsoftisms while also struggling with a lot of pointer basics. This is a recipe for disaster; if you are going down this road you need to go brush up on pointers before trying to use that pointer heavy, messy library.