looping

excuse me, but.. how will i return to the main page. like for example, i finished adding books in the add page, how will i go back to the main page without terminating the program and run it again? pls pls help... >.< pls make it simple.. i really need it.. T.T
Place the whole body of main() inside a loop, like Bazzy mentioned in your previous topic (this is the construction that can be used, of course the input-validation etc. is incomplete):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
int main()
{
    bool quit = false;
    while (!quit)
    {
        /* place your program here */
        
        string input;
        cout<<"Do you want to quit? [yes/no]";
        getline(cin,input)
        {
            if (input == "yes")
            {
                quit = true;
            }
        }
    }
    return 0;
}

i already make my code to loop, now, the only problem is how to display the stored data in the add choice.. pls help...>.<
Topic archived. No new replies allowed.