fork download
  1. #include <stdio.h>
  2.  
  3. void main(void){
  4.  
  5. void hex2asc(int vDec,int*aHex)
  6. {
  7. const char cHexchars[]="0123456789ABCDEF";
  8. const int cHexconst[]= { 0x1000,0x0100,0x0010,0x0001};
  9. int vDigit = 0;
  10. int vTemp=0;
  11. int j;
  12.  
  13. vTemp = vDec; /* save Vdec in temp variable */
  14.  
  15. For(j=0, j<=8, j++) {
  16.  
  17. vDigit = vTemp / cHexconst[j]; /* get current digit */
  18. (*aHex) = cHexchars[vDigit]; /* convert digit to ASCII */
  19. vTemp = vTemp - (cHexconst[j] * vDigit); /* calculate remainder */
  20. aHex++; /* update array pointer */
  21. }
  22.  
  23. if (j=9)(*aHex) = 0x0000; /* add EOS */
  24.  
  25. }
  26.  
  27. EnableInterrupts;
  28.  
  29.  
  30. for(;;) {
  31. _FEED_COP(); /* feeds the dog */
  32. } /* loop forever */
  33. /* please make sure that you never leave main */
  34. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:3: warning: return type of ‘main’ is not ‘int’
prog.c: In function ‘hex2asc’:
prog.c:15: warning: implicit declaration of function ‘For’
prog.c:15: warning: operation on ‘j’ may be undefined
prog.c:15: warning: operation on ‘j’ may be undefined
prog.c:15: error: expected ‘;’ before ‘{’ token
prog.c:9: warning: unused variable ‘vDigit’
prog.c:8: warning: unused variable ‘cHexconst’
prog.c:7: warning: unused variable ‘cHexchars’
prog.c: In function ‘main’:
prog.c:27: error: ‘EnableInterrupts’ undeclared (first use in this function)
prog.c:27: error: (Each undeclared identifier is reported only once
prog.c:27: error: for each function it appears in.)
prog.c:31: warning: implicit declaration of function ‘_FEED_COP’
stdout
Standard output is empty