How to implement variable argument functions ?
Answer Posted / swetcha
Variable-argument functions in C are inherently unsafe
since there is no language-level mechanism to ensure that
the actual arguments agree in type and number with the
arguments that the function will be using. There are
several ways to implement variable argument functions in C
You can try to implement such function by taking the
address of a formal argument and working your way through
the stack frame.A better alternative is to use the
__builtin_next_arg function on gcc and then work your way
up the stack. You can write your variable argument
functions using the standard macros in <stdarg.h> and
<vararg.h>.
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
What are loops c?
What is meant by realloc()?
What is a null string in c?
What is clrscr ()?
Why is c called "mother" language?
Why c is procedure oriented?
What is the difference between volatile and const volatile?
With the help of using classes, write a program to add two numbers.
What is a substring in c?
What is a const pointer?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
What is typedf?
Explain how do you search data in a data file using random access method?
What is the difference between null pointer and wild pointer?
What is the full form of getch?