Compilation Error: itoa

why does the compiler doesn’t recognize itoa string function. I have included and header file.

here is the exact error code :

prog.cpp: In function �int
main()�: prog.cpp:18:33: error:
�itoa� was not declared in this
scope
itoa(k[p-1],buffer,2);
^

If i just copy-paste the code in editor and try to submit it is not recognizing header file.

prog.c:2:20: fatal error: iostream: No
such file or directory #include

^ compilation terminated.

uff after so much of debugging, now have to write a code which is compatible with this compiler.

Probably because it’s a non-standard function, but I’m not sure… But you can use to_string in C++11 or you can still write your own itoa function, which is not that difficult.

that may be about iota but what about iostream, isn’t cin and cout are standard

Well… no idea about that :smiley:

I am using c++98, can you suggest anything

As I said, if you’re out of ideas, you can still write your own itoa function. It should look something like this: http://ideone.com/CCVrh6
It’s probably not the smartest implementation, but it should give you an idea, if you hadn’t yet figured it out.

thanks gogis