cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
restarting a test program from beginning
restarting a test program from beginning
Jul 17, 2011 at 9:05am UTC
metulburr
(585)
OK very new to C++ and i know i will learn this later. I take a test and run it and then tinker with it to try to add more. So i was wondering (to save some time) what source code would reset the program without exiting out of the program?
Jul 17, 2011 at 9:26am UTC
toexii
(79)
I think what you're looking for is a loop.
you could do something like this:
while(input is not the terminator)
run program
very simple demo:
1
2
3
4
5
6
string terminator =
"stop"
;
do
{ cin>>demo; cout<<demo; }
while
(demo != terminator);
Last edited on
Jul 17, 2011 at 9:26am UTC
Jul 17, 2011 at 9:30am UTC
metulburr
(585)
thanks
Topic archived. No new replies allowed.