How to implement variable argument functions ?



How to implement variable argument functions ?..

Answer / 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

More C Interview Questions

write a c program to find reminder and quotient if one number is divided by other.to code this program don't use more than 2 variables

2 Answers   TCS,


What does sizeof int return?

0 Answers  


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

0 Answers   Gamesa, Satyam,


code for replace tabs with equivalent number of blanks

0 Answers   Bosch,


How to compare array with pointer in c?

0 Answers  






How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

0 Answers  


What are file streams?

0 Answers  


can i know the source code for reversing a linked list with out using a temporary variable?

6 Answers   Honeywell,


diff .between strcture and union

2 Answers  


What is the purpose of 'register' keyword in c language?

0 Answers  


what is linkage error when it occurs in c program

3 Answers  


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

0 Answers  


Categories