You have two ways to fix this. The preferred way is to use:
string answer;
(instead of char
). The other possible way to fix it is:
if (answer == 'y') ...
(note single quotes instead of double, representing a char
constant).
More Related Contents:
- Why won't clang compile this source code that works in VS2012?
- Why does this tell me that "gender" is an undeclared identifier on line
- Why does the expression 'a++ += b' give an error?
- C++ Programming Error [duplicate]
- warning C4018: '<' : signed/unsigned mismatch [closed]
- “does not name a type” error c++ [duplicate]
- computer science
- Resolve build errors due to circular dependency amongst classes
- What is an ‘undeclared identifier’ error and how do I fix it?
- “Undefined reference to” template class constructor [duplicate]
- c++ multiple definitions of a variable
- Why is this program erroneously rejected by three C++ compilers?
- How do I concatenate multiple C++ strings on one line?
- invalid conversion from ‘const char*’ to ‘char’
- Identifier not found error on function call
- extra qualification error in C++
- Initializing container of unique_ptrs from initializer list fails with GCC 4.7
- C++ mutex in namespace std does not name a type
- “Symbol(s) not found for architecture x86_64” on QtCreator project
- Fatal error: “No Target Architecture” in Visual Studio
- error::make_unique is not a member of ‘std’
- cc1plus: error: unrecognized command line option “-std=c++11” with g++
- error: Class has not been declared despite header inclusion, and the code compiling fine elsewhere
- Deciphering C++ template error messages
- Linking files in g++
- Can’t get visual studio C++ include file ‘excpt.h’ to get installed
- Assert that code does NOT compile
- constexpr not working if the function is declared inside class scope
- SFINAE tried with bool gives compiler error: “template argument ‘T::value’ involves template parameter” [duplicate]
- How can you compare two character strings statically at compile time