Question about classes in C++

I like what MindWanderer is saying: that it’s not about inventing the perfect organization for your code before you start writing, which is impossible. It’s about continuous improvement and refactoring. On the one hand this approach takes a lot of discipline, because it’s so easy to get lazy and say, “eh, screw it, it’s already written.” On the other, it will give the best and smoothest results. Of course, all that’s a lot easier in C# with IDE refactoring support (ie, automated renaming, etc.). But for C++ there’s also the VisualAssist X plugin which is a big help (it also works with C#).

Wow, so I finally feel like I’ve reached a new level with my programming here.

I FINALLY feel like I have handle on pointers. I can now pretty much put anything where I want it with pointers… without worrying about scope.

I just (whew) passed a pointer to an array of instances of my block class. I wasn’t quite sure how to do it, but in my function I used

(PointerToBlock + i)->MyFunction()

but then I was having problems getting it to work right. It compiled correctly, but still I was having problems, so I went around and changed the variable I was passing to it.

block is what I wanted to pass to it, but it didn’t work, so I passed block[0] instead and it works!

Now I’m going crazy with them. I’m moving stuff wherever the hell I feel like it. I finally don’t have to worry about scope like I used to before for once.

What I am working on now is getting all of my drawing code nestled inside the objects themselves. I then will pass pointers to the render window and sprites that I call in my main function.

Anyway, once I get this stuff a bit less ridiculous, I’ll post some code here. Probably by the end of the day.

PS. thanks again for the insight, I really find it useful.