You are here:

C/c programming

Advertisement


Question
if i want to write a function in C in which fuctions arguments can change dynamically.. e.g like scanf and printf built in function in which we can send number of arument as many as we can ..

Answer
That is called variable arguments.
For that, you will have to make use of VARARGS.
In solaris, there is a file called /usr/include/varargs.h.
If you open this file, you can see many macros.
Of these, try to read the man page of var_start.
It will give links to other macros.

-Narendra

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.