SHARE
TWEET

C ques 17

Dprogrammed1 Apr 5th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<stdarg.h>
  3. void fun1(int num, ...);
  4. void fun2(int num, ...);
  5.  
  6. int main()
  7. {
  8.     fun1(1, "Apple", "Boys", "Cats", "Dogs");
  9.     fun2(2, 12, 13, 14);
  10.     return 0;
  11. }
  12. void fun1(int num, ...)
  13. {
  14.     char *str;
  15.     va_list ptr;
  16.     va_start(ptr, num);
  17.     str = va_arg(ptr, char *);
  18.     printf("%s ", str);
  19. }
  20. void fun2(int num, ...)
  21. {
  22.     va_list ptr;
  23.     va_start(ptr, num);
  24.     num = va_arg(ptr, int);
  25.     printf("%d", num);
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top