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 does c mean in standard form?
What is the difference between c &c++?
Is c object oriented?
What are linker error?
Differentiate abs() function from fabs() function.
Write a program to print factorial of given number using recursion?
List some basic data types in c?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
What is n in c?
Explain spaghetti programming?
What is difference between constant pointer and constant variable?
Explain the advantages of using macro in c language?
Explain what is the benefit of using #define to declare a constant?
Tell me what is the purpose of 'register' keyword in c language?
What does s c mean in text?