***Warning this is for homework.
I am on the final debug for a program of mine. The program is designed to restart your computer upon going beyond the boundaries of your stack. The stack is an array based stack. When it restarts, the program saves the information in the stack to a file and when the computer starts again, it loads the data back into the stack.
The problem I am having is that although it saves the data, when it loads, the data is only a series of zeros. I thought of using ios::nocreate, but my program won't let me use it, saying that its invalid. The appropriate code follows.
Section to place data back into stack:
Section to initiate restart error:Code:
int j = 0;
cout<<"Welcome to the stack
cout<<"Please enjoy yourself."<<endl;
int loop = 5;
cout<<"Now Recovering from Stack
Overflow and System Crash....."<<endl;
while(loop != 0)
cout<<"Now don't do it again Hoser!!!"<<endl;
I have included the right header files. <cstdlib> <fstream>Code:
if(Stackmanip.isItFull() == true)
system("copy A:project3.exe c:\\");
Thank you all.