fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5.  
  6. int PORTA = 0;
  7. int PORTB = 0;
  8.  
  9. int SBIT(char PORT_num, int BIT_num)
  10. {
  11. char Pn;
  12. int Bn;
  13. int E.SBIT
  14.  
  15. Pn = PORT_num;
  16. Bn = BIT_num;
  17.  
  18. if(Pn == "A" ){
  19. if(Bn < 3){
  20. switch(Bn){
  21. case(0):
  22. PORTA = 10;
  23. E.SBIT = 1;
  24. break;
  25. case(1):
  26. PORTA = 11;
  27. E.SBIT = 1;
  28. break;
  29. case(2):
  30. PORTA = 12;
  31. E.SBIT = 1;
  32. break;
  33. case(3):
  34. PORTA = 13;
  35. E.SBIT = 1;
  36. break;
  37. }
  38. }
  39. else E.SET = 0;
  40. break;
  41.  
  42. }
  43. else E.SBIT = 0;
  44. return();
  45. }
  46.  
  47.  
  48.  
  49.  
  50.  
  51. SBIT(A, 1);
  52. printf("%d\n%d",PORTA,PORTB);
  53.  
  54. return 0;
  55. }
  56.  
Compilation error #stdin compilation error #stdout 0s 4440KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘SBIT’:
prog.c:13:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
     int E.SBIT
          ^
prog.c:13:10: error: expected expression before ‘.’ token
prog.c:18:15: warning: comparison between pointer and integer
         if(Pn == "A"  ){
               ^~
prog.c:18:15: warning: comparison with string literal results in unspecified behavior [-Waddress]
prog.c:23:33: error: ‘E’ undeclared (first use in this function)
                                 E.SBIT = 1;
                                 ^
prog.c:23:33: note: each undeclared identifier is reported only once for each function it appears in
prog.c:40:17: error: break statement not within loop or switch
                 break;
                 ^~~~~
prog.c:44:8: error: expected expression before ‘)’ token
 return();
        ^
prog.c: In function ‘main’:
prog.c:51:9: error: ‘A’ undeclared (first use in this function)
    SBIT(A, 1);
         ^
stdout
Standard output is empty