fork download
  1. #include <stdio.h>
  2. #include "myheader.h"
  3.  
  4. int main(void)
  5. {
  6. int a = 0;
  7. int b = 0;
  8.  
  9. printf("輸入A=");
  10. scanf_s("%d", &a);
  11. printf("輸入B=");
  12. scanf_s("%d", &b);
  13.  
  14. func(a, b);
  15.  
  16. return 0;
  17. }
  18.  
  19. void func(int a, int b)
  20. {
  21. int c = 0;
  22. int d = 0;
  23.  
  24. for (c = 0; c <= b; c++)
  25. {
  26. d = 5 * a + 4 * c;
  27.  
  28. printf("5*%d+4*%d=%d\n", a, c, d);
  29. }
  30. }
  31.  
  32.  
  33. In myheader.h
  34.  
  35. #ifndef _MYHEADER_H_
  36. #define _MYHEADER_H
  37.  
  38. void func(int a, int b);
  39.  
  40. #endif
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2:22: fatal error: myheader.h: No such file or directory
 #include "myheader.h"
                      ^
compilation terminated.
stdout
Standard output is empty