C
C
Coder 14482020-08-23 23:00:13
C++ / C#
Coder 1448, 2020-08-23 23:00:13

How to fix "Expression result unused" warning in C++ LLVM compiler?

cin;
This is where the compiler gets angry. I just need a response from the user to press any key. Assign the answer to a variable, and then just use it like that ... well, you yourself understand, complete imbecility. And to see a yellow warning is not a hunt, and according to the rules this should not be. How to get out of the situation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Demidko, 2020-08-24
@wows15

To wait for any key to be pressed is traditionally usedstd::cin.get()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question