How to define a variable that holds letters? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to define a variable that holds letters?

20th Sep 2017, 4:04 PM
Sidhant Thapa
Sidhant Thapa - avatar
2 Answers
0
For one character you can use char: char ch = 'a'; For multiple characters you can use string: std::string str = "abc";
20th Sep 2017, 4:12 PM
aklex
aklex - avatar
0
thank you for the help
20th Sep 2017, 4:14 PM
Sidhant Thapa
Sidhant Thapa - avatar