Do I use malloc() by int location[320][240]; malloc(sizeof(location * 320 * 240));
or by something like malloc(location[320][240]
This is my second day using C and I haven't used C++ in a while so I am a bit fuzzy on everything.
I am using the array to store the color of the the pixel while the cursor is set at that location so I can restore it after the cursor is moved to the next pixel.
P.S. Do you have the addresses of the other keys, especially The clickpad and the clickpad button, I have no idea where to start when looking for key addresses
I was just reading up on some stuff... am i supposed to use something like this for every variable I declare int i malloc(sizeof(i)); int location[320][240] malloc(sizeof(location*320*240));
[/color]
P.S. I know it would use less memory if I just checked the location of the pixel saved it to an int then moved across and changed back the last visited pixel to the right color, however I was later going to use the 240*320 array to save the drawing .