The following is way to convert bool to string
#include <sstream>
bool b = 10;
std::stringstream stringStream;
stringStream << std::boolalpha << b;
std::string str = stringStream.str();
std::cout << str.c_str();
or
#include <string.h>
std::cout << std::to_string(b);
Commentaires