+ 2

How do I Extract Single letter from a given word in c++?

I am a beginnner and I am writing a code where i am supposed to extract characters from a word. Eg:- The input "CODE" would return "C", "O", "D", "E" Any help would be much appreciated.

28th Apr 2018, 11:14 AM
Anu Chhetri
Anu Chhetri - avatar
3 Respuestas
+ 6
string word="code"; char a=word[0]; char b=word[1]; e.t.c strings behave like arrays
28th Apr 2018, 11:17 AM
᠌᠌Code X
᠌᠌Code X - avatar
0
Thank you guys! I got my program to work.
28th Apr 2018, 3:38 PM
Anu Chhetri
Anu Chhetri - avatar