View Single Post
Old Mar 30th, 2008, 6:25 PM   #9
Marijan
Newbie
 
Join Date: Feb 2008
Posts: 15
Rep Power: 0 Marijan is on a distinguished road
Re: Got stuck while making a program,help would be appreciated

Quote:
Originally Posted by Freaky Chris View Post
The reason why your having trouble with space is not to do with the code that is changing the letter, but the method that you accept input.

cin only accepts 1 word upto a space character, so instead you should implement something like this

C++ Syntax (Toggle Plain Text)
  1. char Vs[200];
  2. cin.getline(Vs, 200);

EDIT: this is perhaps the better way

C++ Syntax (Toggle Plain Text)
  1. string Vs;
  2. getline(cin, Vs);

im really not thinking straight tonight

getline()
Chris

Yes dude thank you,you are tottaly right,what was i thinking,i guess i am not thinking at all tonight,will fix that now,going to bed to be as fresh as i can be for tomorow.
Marijan is offline   Reply With Quote