R
rob
hello all. im a newbie in C++ and programing in general. what i am
having problem with is taking user input, putting it into a string and
then displaying that string again. i am using the dev C++ compiler.
here is the code
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
string name;
cout << "Enter name: ";
cin >> name;
cout << endl << "Your name is " << name << endl;
cin.get();
return 0;
}
it will let me input what ever i want but nothing happens when i hit
enter, the window just stays blank until i hit enter again then the
window closes.
thanks for any help
having problem with is taking user input, putting it into a string and
then displaying that string again. i am using the dev C++ compiler.
here is the code
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
string name;
cout << "Enter name: ";
cin >> name;
cout << endl << "Your name is " << name << endl;
cin.get();
return 0;
}
it will let me input what ever i want but nothing happens when i hit
enter, the window just stays blank until i hit enter again then the
window closes.
thanks for any help