Interview Question

Firmware Engineer Interview Atlanta, GA

how do u pass Variable number of arguments in C?

Answer

Interview Answer

1 Answer

1

The secret to passing variable number and type of arguments is the stdarg library. It provides the va_list data-type, which can contain the list of arguments passed into a function.
The stdarg library also provides several macros : var_arg, va_start, and va_end that are useful for manipulating the argument-list.

mahesh on Jul 31, 2012

Add Answers or Comments

To comment on this Question, Sign In with Facebook or Sign Up