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
Char variables
Char variables
Jan 27, 2018 at 8:09pm UTC
fivestar
(180)
is it possible to have someone enter two letters on same line and have those two characters stored as seperate char variables while only having initialized two char variables in the beginning?
Jan 27, 2018 at 8:26pm UTC
Handy Andy
(5051)
Hello fivestar,
Yes. I believe what you want is
std::cin >> charA >> charB;
and your entry from the keyboard would be
A B
Enter.
If not you will need to explain your self better.
Andy
Jan 27, 2018 at 8:33pm UTC
fivestar
(180)
Thank you thats exactly what i meant.
Topic archived. No new replies allowed.