G
G
Gagatyn2016-09-08 22:56:15
C++ / C#
Gagatyn, 2016-09-08 22:56:15

How to store a word in a variable?

How to write the answer word into a variable? According to this code, when you start the console by entering the first answer, it jumps to the 3rd question and ends. When displaying variables, draws " ¤ ". What to do?

setlocale(0, "");
char answ1, answ2, answ3;

cout << "Ответ 1 "; cin >> answ1;
cout << "Ответ 2 "; cin >> answ2;
cout << "Ответ 3 "; cin >> answ3;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Moseychuk, 2016-09-09
@Gagatyn

std::string answ1, answ2, answ3;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question