Original Post
I am using this code.
code starts//////////////////
#include
void main()
{
char name[50];
cout<<"Please enter your name: ";
cin.getline(name, 49);
cout<<"\n\nHello, "<
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
string name;
cout << "What is your name?";
getline(cin, name);
cout << endl << endl << "Hello, " << name << endl;
return 0;
}
...
if(name == "quit") // note double quotes
{
return 0;
}
|
|
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more