0
How do a input a sentence as a variable?
I've tried a few methods Char a; Char a(.); Char a{.}; The output only prints one character Char a[any number]; this allows no limit of words but does not allow spaces to create sentences I'd like something like Cout<<"you are a"<<a; //*outputs You are a wizard harry Thank you
3 Réponses
+ 3
you want to look into strings.
+ 3
[] is usually an array. You want to use a string instead of a char as they are fundametally different and chars is not meant to be used like this.
0
Also im curious as to know why there is no difference between the first three
And what does the number in the [] in the fourth method represent.
Tha