Don't use dynamic memory.
Just use a vector.
std::vector<int> iVec;
Then just iVec.push_back(element);
to add to it.
ill just show you the while loop please explain it to me from there
while (count > 4)
{
SetPixel(hdc, 0 + x[count], 0 + y[count], c);
count --;
}
What exactly are you trying to do? That just looks like your accessing a couple arrays.
I am it wont work im trying to have a variable declare a position in an array in a setpixel function
What error are you getting?
expression must have a pointer-to-object type
That doesn't sound like an error applying that snippet.
it is saying it about x[count]
Well first off your accessing memory outside of that array. From your loop, I assume count starts off >= 4?
Last edited on