How to Solve Error:‘itoa’ was not declared in this scope

Some compilers do not support itoa because it is not standard.

Solution

    • c++11: std:: to_string
    • sprintf
      1. stdio.h
      2. char *c = new char;
        sprintf(c,"%d",num);
    • stringstream
      1. sstream.h
      2. stringstream ss; int x = 1;
        ss << x;
        string str = ss.str();


Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *