You need to add the following:
#include <string>
Related Posts:
- Split a string using C++11
- printf with std::string?
- error C2679: binary ‘<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
- convert string to size_t
- Why the switch statement cannot be applied on strings?
- How to convert string to char array in C++?
- How can I convert a std::string to int?
- Why is “using namespace std;” considered bad practice?
- What is a lambda expression in C++11?
- How to convert string to char array in C++?
- What is `CString`?
- What is the ‘override’ keyword in C++ used for? [duplicate]
- What is a smart pointer and when should I use one?
- C++ std::priority_queue uses the lambda expression
- Usage and Syntax of std::function
- What exactly is nullptr?
- How to convert a char array to a string?
- Difference between `constexpr` and `const`
- How do I iterate over the words of a string?
- How to convert an instance of std::string to lower case
- Returning an empty string : efficient way in c++
- How to reverse an std::string? [duplicate]
- Compiling C++11 with g++
- What exactly is std::atomic?
- Issue with std::stol – ‘std::invalid_argument’ what(): stol
- terminate called after throwing an instance of ‘std::out_of_range’
- Why am I getting string does not name a type Error?
- undefined reference to ‘std::cout’
- What is move semantics?
- expression preceding parentheses of apparent call must have (pointer-to-) function type
- C++ deprecated conversion from string constant to ‘char*’
- C++ terminate called without an active exception
- identifier “string” undefined?
- The #include
exists, but I get an error: identifier “cout” is undefined. Why? - Converting a vector
to string - How can I convert const char* to string and then back to char*?
- std::string formatting like sprintf
- Sorting Characters Of A C++ String
- basic_string::_M_construct null not valid after constructing subvector of strings
- How to copy a string of std::string type in C++?
- How to return a string from a C++ function?
- std::out_of_range error?
- What is the difference between isdigit() and isnumber()?
- Convert char* to string C++
- Difference in make_shared and normal shared_ptr in C++
- Right way to split an std::string into a vector
- string subscript out of range error
- C++ String Variable Declaration
- push_back vs emplace_back
- Returning an empty string : efficient way in c++
- error: use of deleted function
- c++ convert string to hex
- How can I iterate through a string and also know the index (current position)?
- c++ parse int from string [duplicate]
- Hash function for a string
- expected unqualified-id before string constant
- cc1plus: error: unrecognized command line option “-std=c++11” with g++
- C++ Simple hangman game
- std::cin input with spaces?
- Remove First and Last Character C++
- C++ Convert string (or char*) to wstring (or wchar_t*)
- Hash function for a string
- no match for ‘operator<<’ in ‘std::operator
- Dynamically allocated string array, then change it’s value?
- Use the auto keyword in C++ STL
- Fastest way to Convert String to Binary?
- Does C++11 have C#-style properties?
- Why I cannot cout a string?
- How to print a string in C++
- How do I create a random alpha-numeric string in C++?
- Trying to use int in getline
- error: switch quantity not an integer
- LLVM Compiler 2.0: Warning with “using namespace std;”
- Reading a string from file c++
- When is it safe to call this-> in constructor and destructor
- How to change string into QString?
- How to memset char array with null terminating character?
- Remove last character from C++ string
- Converting String to Cstring in C++
- How well is Unicode supported in C++11?
- How to do std::string indexof in C++ that returns index of matching string?
- The CXX compiler identification is unknown
- How to automatically convert strongly typed enum into int?
- variable or field declared void
- Function stoi not declared
- Creating folders in C++
- MSVCP120d.dll missing
- Understanding error “terminate called after throwing an instance of ‘std::length_error’ what(): basic_string::_S_create Aborted (core dumped)”
- ‘setprecision’ is not a member of ‘std’
- Compiling C++11 with g++
- enum to string in modern C++11 / C++14 / C++17 and future C++20
- ERROR C2039: ‘vector’: is not a member of ‘std’
- Converting bool to text in C++
- c++ vector bubble sort
- Why are there two different getline() functions (if indeed there are)?
- How to find and replace string?
- How to use bitmask?
- Declaration is incompatible with type
- I’m getting the error “stoi is not a member of std” in myprogramminglab [duplicate]
- Differences between unique_ptr and shared_ptr