How to implement variable argument functions ?
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 |
List some of the dynamic data structures in C?
What is the real difference between arrays and pointers?
27 Answers Hexaware, Logic Pro, TCS,
Why do we need a structure?
Differentiate between new and malloc(), delete and free() ?
Why c is a mother language?
Write a progarm to find the length of string using switch case?
what is the use of bitfields & where do we use them?
Write a program to swap two numbers without using a temporary variable?
how can i print "hello"
main() {int i=5; // line 1 i=(++i)/(i++); // line 2 printf("%d",i); // line 3 } output is 2 but if we replace line 2 and line 3 by printf("%d",i=(++i)/(i++)); then output is 1. Why?
Program to trim a given character from a string.
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.