If I try

// to_string example
#include <iostream>   // std::cout
#include <string>     // std::string, std::to_string

int main ()
    std::string pi = "pi is " + std::to_string(3.1415926);
    std::string perfect = std::to_string(1+2+4+7+14) + " is a perfect number";
    std::cout << pi << '\n';
    std::cout << perfect << '\n';
    return 0;

flycheck give me:

 7  35 error           no member named 'to_string' in namespace 'std' (c/c++-clang)
 8  29 error           no member named 'to_string' in namespace 'std' (c/c++-clang)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.