How can I test for overload on an array?
Below is what I'm currently using. I basically declare a 15 integer array, and want to issue an overload error if it exceeds the available memory allocation.
I'm assuming this should work, but it doesn't.
cout<<"You have exceeded you memory allocation";
The easiest way is to learn the STL vector class. Alternatively you could write a stripped down version of the vector class, or the equivalent thereof using flags and counters.