When I have a simple program like below:
#include <cstdlib>
#include <iostream>
#include <string.h>
using namespace std;
string somevariable;
int main(int argc, char *argv[])
{
cout << "Enter something: " << endl;
cin >> somevariable;
cout << somevariable;
system("PAUSE");
return EXIT_SUCCESS;
}
When I input 2 words (e.g. one two), the program only stores the first one, and the next on is either dropped or sent on to the next cin. It does the same thing with char[] and integers! Maybe this is just being caused by a setting on command prompt?
Thank in advance for any help.
AJ32

New Topic/Question
Reply




MultiQuote






|