View Single Post
Old Apr 26th, 2005, 12:53 AM   #5
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5 bl00dninja is on a distinguished road
this is one of those cases when you want to use malloc(C) or new(C++) to allocate your memory dynamically. this way, when you have LESS than 1000, you're not wasting any space. however, this gets more into pointers and the like so i would suggest doing what stalin said and test for your "fullness" condition BEFORE adding data to the array.

i'm a little drunk right now so "beer" with me...this might do it, but i'm not sure
if (note[999] != NULL)
    {
         cout<<"too much data!"<<endl;
         //<--now do something here to skip it, exit, whatever
    }
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.

Last edited by bl00dninja; Apr 26th, 2005 at 12:58 AM.
bl00dninja is offline   Reply With Quote