+ 1
why this code is not working?
/* Explanation: itoa()Â takes the integer input value input and converts it to a number in base radix. The resulting number a sequence of base-radix digits. Example: itoa() example */ #include<stdio.h> #include<stdlib.h> int main () { int no; char buff [50]; printf ("Enter number: "); scanf ("%d",&no); itoa(no,buff,10); printf ("Decimal: %s\n",buff); itoa(no,buff,2); printf ("Binary: %s\n",buff); itoa(no,buff,16); printfp("Hexadecimal: %s\n",buff); return 0; } https://code.sololearn.com/cqxi0gx7usKR/?ref=app
2 Answers
+ 2
itoa() is non-standard function, you can't be sure about its availability in various systems
https://www.cplusplus.com/reference/cstdlib/itoa/
https://stackoverflow.com/questions/190229/where-is-the-itoa-function-in-linux
0
Ur-Wellwisher You can use ssprintf() as an alternative to itoa().