Advertisement
ptkrisada

foo.c (number of arguments being passed)

Dec 15th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. /* prototype */
  4. void foo(); /* valid in C but not C++ */
  5.  
  6. int main()
  7. {
  8.     foo(1);
  9. /*  foo(); no, it is illegal. */
  10.     return 0;
  11. }
  12.  
  13. /* implementation */
  14. void foo(int n)
  15. {
  16.     printf("%d\n", n);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement