Original Post
Hi everyone, I'm having quite a bit of trouble with arrays and variables declared after them. The problem is that the 'kind' variable gets the same memory address as the last element in the array I declared ( actually, the same address as the first member variable in the last element ), which really messes everything up. It's been spooking me for a really long time and I've redone loads of stuff because I couldn't figure out why my variable was changing without being explicitly changed. There must be some kind of way to avoid this, please help! I'd be grateful for any :) Thanks teo
class Block
{
private:
SDL_Rect squares[3];
blockType kind;
...