- 1

Pls someone should help with if i want declare a variable that is not a number. i.e a words.

23rd Jan 2021, 2:18 PM
abdulsamad adamu
7 Answers
+ 3
abdulsamad adamu , here is a sample with int, string and char. char is only suited for a single character, not for words. include <iostream> using namespace std; int main() { int number; string name; char letter; cin >> number; cin >> name; cin >> letter; cout << number << endl; cout << name << endl; cout << letter << endl; return 0; }
23rd Jan 2021, 3:56 PM
Lothar
Lothar - avatar
+ 1
give some more info. what language is it? do you have an example problem?
23rd Jan 2021, 2:20 PM
Steve Barone
Steve Barone - avatar
0
It's English language. I want declared a word cloudy as a variable I used "char" is showing errors
23rd Jan 2021, 2:23 PM
abdulsamad adamu
0
sorry i meant coding language. python, c, java, what are you using?
23rd Jan 2021, 2:28 PM
Steve Barone
Steve Barone - avatar
0
C++
23rd Jan 2021, 2:34 PM
abdulsamad adamu
0
you should edit the post tags to include that. i dont know c++ so i cant help sorry!
23rd Jan 2021, 2:47 PM
Steve Barone
Steve Barone - avatar
0
Thanks you very much
23rd Jan 2021, 6:20 PM
abdulsamad adamu