fork download
  1. typedef int(*p_hobby)(int hour)
  2.  
  3. typedef struct{
  4. int gender;
  5. int heigh;
  6. p_hobby hobby;
  7. }DETAIL_T
  8.  
  9. typedef struct{
  10. int name;
  11. DETAIL_T* DETAIL;
  12. }A_Type;
  13.  
  14. /*A_file.c*/
  15.  
  16. A_Type arr1[] = {
  17. {James, Jemes_detail}, //James is defined somewhere like #define James 1
  18. }
  19.  
  20. /*B_file.c*/
  21. DETAIL_T Jemes_detail[]={
  22. {BOY, 183, BASKETBALL},
  23. {BOY, 200, SCOOTOR},
  24. {BOY, 150, SWIMMING},
  25. }
  26.  
  27. /*C_file.h*/
  28. #define BASKETBALL PLAY_BASKETBALL
  29. #define SCOOTOR RIDE_SCOOTER
  30. #define SWIMMING GO_SWIMMING
  31.  
  32. /*D_file.c*/
  33. int PLAY_BASKETBALL(int time){
  34. /*implementation*/
  35. }
  36. int RIDE_SCOOTER(int time){
  37. /*implementation*/
  38. }
  39. int GO_SWIMMING(int time){
  40. /*implementation*/
  41. }
  42.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:3:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
 typedef struct{
 ^~~~~~~
prog.c:9:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
 typedef struct{
 ^~~~~~~
prog.c:17:3: error: ‘James’ undeclared here (not in a function)
  {James, Jemes_detail}, //James is defined somewhere like #define James 1
   ^~~~~
prog.c:17:3: warning: excess elements in struct initializer
prog.c:17:3: note: (near initialization for ‘arr1[0]’)
prog.c:17:10: error: ‘Jemes_detail’ undeclared here (not in a function)
  {James, Jemes_detail}, //James is defined somewhere like #define James 1
          ^~~~~~~~~~~~
prog.c:17:10: warning: excess elements in struct initializer
prog.c:17:10: note: (near initialization for ‘arr1[0]’)
prog.c:21:1: error: expected ‘,’ or ‘;’ before ‘DETAIL_T’
 DETAIL_T Jemes_detail[]={
 ^~~~~~~~
prog.c: In function ‘PLAY_BASKETBALL’:
prog.c:35:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
prog.c: In function ‘RIDE_SCOOTER’:
prog.c:38:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
prog.c: In function ‘GO_SWIMMING’:
prog.c:41:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
stdout
Standard output is empty