View Single Post
Old Mar 30th, 2008, 6:08 PM   #8
Freaky Chris
Professional Programmer
 
Freaky Chris's Avatar
 
Join Date: Dec 2007
Location: England
Posts: 448
Rep Power: 1 Freaky Chris is on a distinguished road
Send a message via MSN to Freaky Chris
Re: Got stuck while making a program,help would be appreciated

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
__________________
Steven Skiena - Algorithms

,[->+>+<<]>>[-<<+>>]>++++++++[-<++++++++>]<+[-<->]>+<<[[-]+++++++++++++++.[-]>]>>[+++++++++.[-]],
brainf**k -- It's such a pretty language
Freaky Chris is offline   Reply With Quote