cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Simplest(!) string problem
Simplest(!) string problem
Apr 11, 2013 at 3:21pm UTC
Sam99
(36)
1
2
3
4
5
6
char
a[5]; cout<<
"Enter word: "
; cin.get(a, 6,
'\n'
); cin.ignore(2000,
'\n'
); cout<<
//?
If I input a word "Hello"; and I want to display an individual letter from that; for example 'H', or 'l' or 'o', what should be in cout part?
Anyone there to help?
Apr 11, 2013 at 3:27pm UTC
mutexe
(2372)
use a std::string not a char array, then use the [] operator.
Topic archived. No new replies allowed.