October 5th, 2003, 11:52 PM
Reading Strings with Spaces
I've having a wierd problem with some code I'm working with in which both the scanf and cin functions are reading input with spaces as two seperate strings rather that as one string that happens to contain characters. Is there anyway I can get around this? Thanks,
October 6th, 2003, 12:34 AM
Use fgets() or cin.getline() instead.
#define SIZE 80
fgets(buf, SIZE, stdin);
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
October 6th, 2003, 08:59 AM
October 7th, 2003, 12:15 AM
Thanks, works like a charm.