Way C++ has driven you insane.

Recently I was using a pair of 2d arrays. Let me tell you I really regret it. First I just tried making them private class members allocated on the stack, and that really just screwed everything up. It was a pain making sure arrays or elements were getting around ok, and it seemed every single time I tried just using one of them for something menial it would either not compile or do something else completely unexpected.

Eventually I just said screw it, and went dynamic. Sure enough, making a 2d dynamic array is kind of weird, but I thought "Oh well suck it up, too late to get out of this now". Yeah that didn't really help either.

I leave it to your imagination on how I still suffered horrors before I finally got things to work the way I wanted them to. I really wish it was mentioned somewhere in one of my books that MD are one of the most absolutely painful things to work with.

So, what's a not-so-pleasant past experience of yours with C++?
Last edited on
closed account (N36fSL3A)
Using multidimensional vectors when I was new.

I hate it and will never do it again.
Well, Disch did try to warn you:

Multidimentional arrays are evil
http://www.cplusplus.com/articles/G8hv0pDG/

Andy
Last edited on
closed account (N36fSL3A)
That'd be more useful at the time :(

I actually considered using them for my map, then I just realized it'd be better if I just used a single dimension array and had a width and height variable.
Well, Disch did try to warn you:

Multidimentional arrays are evil
http://www.cplusplus.com/articles/G8hv0pDG/

Andy


Oh how I wish I had seen that article before ),:
Topic archived. No new replies allowed.