the program is of an address book. the syntax is all fine, and the initial menu of options does show up. but once you punch in the cin, the program just stops. any help would be really appreciated, thanks!
@cire hit the nail on the head, but just a side note tip for you: You should almost always have an else case in your if-else blocks to catch any erroneous input.
Right now, I could type in like 7 or 12 or TreskyIsAwesome and the program would just shut down without telling me what happened. So it is always good to have an else case to catch bad inputs, so it can tell me "Invalid Input" and let me try again.
The while loop will take care of going back from the beginning.
Basically, when an expression inside the while loop is evaluated as true (1 IS evaluated to always true), some code will be executed.
1 2 3 4 5 6 7
int main()
{
while(1)
{
cout << "xo";
}
}
Will write an endless line of "xoxoxoxoxoxoxoxo".
Now, how will it ever stop?
Well, either the value to be evaluated becomes false (or 0), or you have a break statement inside the loop.