Advertisement
illwieckz

c-kr.c

Oct 4th, 2021 (edited)
1,596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. # How to compile and run:
  2. #   gcc -pedantic -Wall -Werror c-kr.c -o c-kr
  3. #   ./c-kr
  4.  
  5. #include <stdio.h>
  6.  
  7. int func0(i) int i; {
  8.     return i;
  9. }
  10.  
  11. int func1() {
  12.     return 5;
  13. }
  14.  
  15. int main(int argc, char** argv) {
  16.     printf("0,0: %d\n", func0());
  17.     printf("0,1: %d\n", func0(1));
  18.     printf("0,2: %d\n", func0(2, 3, 4));
  19.     printf("0,3: %d\n", func0('c', "test", func0, 3));
  20.     printf("0,4: %d\n", func0("test", 'c', func0, 3));
  21.     printf("0,5: %d\n", func0(func0, "test", 'c', 3));
  22.     printf("1,0: %d\n", func1());
  23.     printf("1,1: %d\n", func1(1));
  24.     printf("1,2: %d\n", func1(2, 3, 4));
  25.     printf("1,3: %d\n", func1('c', "test", func1, 3));
  26.     printf("1,4: %d\n", func1("test", 'c', func1, 3));
  27.     printf("1,5: %d\n", func1(func1, "test", 'c', 3));
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement