fork download
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <climits>
  4. using namespace std;
  5.  
  6. void Int2Char(char *Result, unsigned int ToConvert)
  7. {
  8. uchar Digit[5];
  9. int c;
  10. unsigned int H1,H2;
  11.  
  12. H1=ToConvert;
  13. H2=10000; // Needed because PinguinoC lacks pow function.
  14.  
  15. for (c=4;c>0;c--)
  16. {
  17. Digit[c] = H1/H2;
  18. H1 %=H2; // use of modulo operator or H1 = H1 - Digit[c]*H2
  19. H2=H2/10;
  20. Result[4-c]=Digit[c]+48;
  21. }
  22. Result[4]=H1+48;
  23. }
  24.  
  25.  
  26. int main() {
  27. char Decimal[5]; // This array of char will hold the endresult of Int2Char
  28. unsigned int Test; // This will hold the int you want to be converted
  29.  
  30. Test=4294966696;
  31. Int2Char(Decimal,4294966696);
  32. return 0;
  33. }
Compilation error #stdin compilation error #stdout 0s 3096KB
stdin
Standard input is empty
compilation info
prog.cpp:30:3: warning: this decimal constant is unsigned only in ISO C90
   Test=4294966696;
   ^
prog.cpp:31:3: warning: this decimal constant is unsigned only in ISO C90
   Int2Char(Decimal,4294966696);
   ^
prog.cpp: In function 'void Int2Char(char*, unsigned int)':
prog.cpp:8:3: error: 'uchar' was not declared in this scope
   uchar Digit[5];
   ^
prog.cpp:17:5: error: 'Digit' was not declared in this scope
     Digit[c] = H1/H2;
     ^
stdout
Standard output is empty