+ 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

6th May 2022, 2:45 AM
Ur-Wellwisher
Ur-Wellwisher - avatar
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
6th May 2022, 3:14 AM
Ipang
0
Ur-Wellwisher You can use ssprintf() as an alternative to itoa().
6th May 2022, 1:07 PM
Brian
Brian - avatar