eg how do i do this!
cin>>text;
i then input "VOTE YES!"
This is a discussion on how do i store charecters with spaces? within the C++ Programming forums, part of the General Programming Boards category; eg how do i do this! cin>>text; i then input "VOTE YES!"...
eg how do i do this!
cin>>text;
i then input "VOTE YES!"
char text[10];
cout << "Enter something";
cin >> text;
i.e make text an array of char big enough to store the result.
colin.
cin.getline ( text, TEXTLEN );
Where TEXTLEN is the number of elements in your string. cin with the >> operator will use whitespace as a delimiter while getline uses a newline character.
-Prelude
My best code is written with the delete key.