trouble getting goAgain loop to work

I've been practicing creating do while loops to keep a program open.
I've seen a method used that prompts the user to input either y/n, but I can only get it to loop with numbers and not letters.
would appreciate any help ty.

using namespace std;

int main ()


int goAgain;

do {
cout<< "would you like to go again? y/n \n";

cin>> goAgain;

}while (goAgain == 'y');

return 0;

Change int goAgain; to char goAgain;.
thank you
Topic archived. No new replies allowed.