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

how do you programme Carrier Sense Multiple Access

0 Answers  


write a progam to compare the string using switch case?

1 Answers  


what are bps & baud rates? differentiate these two?

2 Answers   TCS,


What are the types of type qualifiers in c?

0 Answers  


How can I delete a file?

0 Answers  






What are compound statements?

0 Answers  


Are pointers integer?

0 Answers  


write a program to concatenation the string using switch case?

0 Answers  


what is the differance between pass by reference and pass by value.

7 Answers   Infosys,


how do you redirect stdout value from a program to a file?

1 Answers  


What is nested structure?

0 Answers  


Write a program that takes a 5 digit number and calculates 2 power that number and prints it

5 Answers   ABS, Accenture, HCL, Infosys, Infotech, SoftSolve, Software India, TCS, Vertex, Vimukti Technologies,


Categories