C++ class problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C++ class problem

Can anyone tell my what's wrong in this code https://code.sololearn.com/c8l3m96k1WP2/?ref=app I can input "cin >> w;" Why?

4th Nov 2018, 12:03 PM
Alpha
Alpha - avatar
5 Answers
+ 3
I meant char
4th Nov 2018, 1:12 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 2
But I am not sure what you want to do
4th Nov 2018, 1:12 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 1
In fact, y has a random value, maybe 0, maybe not You may have wanted to input characters and the user to pick one instead of integers ? (Ex: answer == 'y')
4th Nov 2018, 12:13 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
0
Like string?
4th Nov 2018, 12:18 PM
Alpha
Alpha - avatar
0
Are you have copy this code to your Ide
4th Nov 2018, 1:22 PM
Alpha
Alpha - avatar