View Single Post
Old Apr 25th, 2005, 9:40 PM   #3
brokenhope
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 126
Rep Power: 4 brokenhope is on a distinguished road
Ah thanks, I also updated the code a bit so its a little better... but the next thing I want to do is try to prevent overflows... since sometimes there will be more than 1000 characters inputed, so I dont know what to do in this case... what ive got is:

void addNote() {
cout << "Enter the text for the note: ";
char note[1000];
cin.ignore();
gets ( note );
cout << note;
}

Whenever I enter more than 1000 the application is forced to close, so any ways to prevent overflows? or automaticaly assign more memory? I think I read something about this in a dynamic memory tutorial but I didnt understand it much...
brokenhope is offline   Reply With Quote