the easiest way to do a loop like you want is to start it with this expression here
that automatically evaluates to true and will loop forever. then whenever you want to exit the loop you add the keyword
after any time you want to exit the loop, usually when the user wants to quit the program.
you also use the keyword
after any time you want to start back up at the beginning of the loop
try something like this:
#include <stdio.h>
int main()
{
while(1)
{
char uchoice;
puts("wanna quit?");
scanf("%c", &uchoice);
if (uchoice == 'y')
{
break;
}
}
return 0;
}
or in C++
#include <iostream>
using namespace std;
int main()
{
while(1)
{
char uchoice;
cout<<"wanna quit?"<<endl;
cin>>uchoice;
if (uchoice == 'y')
{
break;
}
}
return 0;
}