- Nov 26, 2000
- 9,114
- 0
- 76
How do I read in a string from the console?
so i am asking basically whats the equivalent of
char s[20];
cin.getline(s,20);
so i am asking basically whats the equivalent of
char s[20];
cin.getline(s,20);
Originally posted by: gopunk
whoa that's hella annoying.... why didnt' they make it easier?![]()
Originally posted by: Kilrsat
Originally posted by: gopunk
whoa that's hella annoying.... why didnt' they make it easier?![]()
Because with a few simple modifications on the code I posted, it can be used to read from a network source, a file on the drive, a telnet session
So while reading from the commandline might take a few extra steps, once you learn that, you're ready to tackle reading most anything.
So while reading from the commandline might take a few extra steps, once you learn that, you're ready to tackle reading most anything.
do you think you can post the easier waythanks for the help BTW
