1. How do I make the program go back to a particular line in a program.
As an example Basic has the goto command. I am trying to recreate a program I wrote in basic a long time ago, but C++ is not as easy to manipulate.
2. When should one use endl; as opposed to just using;. "end;" just seems to pop us randomly in the book in the same places where it seems I could put ";" and have the same result.
PS:I am using a book for beginners, and while it is keeping things simple there are many things that are not in detail, probably so people don't get confused. I will probably have to get a book that goes into a little more detail soon.
1. Use a loop such as do...while.
2. Depending on whether you need a newline character at the end of an output or not.
Search for online tutorials for details.
The best way to learn programming is through practice.
If I were you, for the 2nd question, I would write the following simple code and examine the difference on the console myself. cout << "Hello!" << endl;cout << "Hello!";
I am not porting the program. I am writing it from scratch using C++. The program is very simple, at least it was in basic anyway, but things in C++ are not so easy to do. I was basically able to return to line X from any point in the basic program by using the goto command.
I am thinking I will have to do a nested loop. They look so messy to me though. Thanks for the help everyone.