Some compilers do not support itoa because it is not standard.
Solution
-
- c++11: std:: to_string
- sprintf
-
-
- stdio.h
char *c = new char;
sprintf(c,"%d",num);
-
-
- stringstream
-
-
- sstream.h
stringstream ss; int x = 1;
ss << x;
string str = ss.str();
-