I'll hijack this thread again for a bit.
So, I'm working on some stuff for uni, and I needed a 2d array, to simulate a matrix. After I got a stack overflow, I went to learn about the stack and the heap. Since my matrix is big, I needed to declare it using the new operator (I'm using C++ btw), but I discover you can't declare a 2d array using new.
So I went to search around on the net, and there's loads of convoluted solutions and stuffies, but one dude suggests:
Use the keyword auto:
auto array_of_something = new something[x][y];
And it works! It seems it only works on C++11 forward, but VS2010 ain't complaining about it, so :shrugs:
Anyway, my question is, what the fuck does the auto do in this case? Because I was JUST today reading about that stuff, and the C++ primer (which is probably C++03 compliant, since it's from 2005) says auto was a keyword to tell the compiler a variable had block scope, which they do by default and it was not actually needed. I read the C++11 improvements, and there's no mention of 2d arrays working with auto now.
So, why does this work?
EDIT: And how do I call delete[] on it?
EDIT2: How do I check the size of an object made from a class I made? And how do I check the size of the stack so I have an idea if I'm close to filling it up? Also, does the stack change from machine to machine, or if I compile for a different OS?