Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   (...) as the function input parameters. (http://www.go4expert.com/forums/function-input-parameters-t585/)

aspguy 11Feb2006 19:06

(...) as the function input parameters.
 
When i declare a function in C , with (...) in the input area, how do I refer to these variable in the function ??

coderzone 11Feb2006 22:26

Re: (...) as the function input parameters.
 
(...) in any function means that the function has variable no of parameters and so the parameters can be determined by the First parameter of the argument list. The best example of such function is printf.

You can get the argument passed to the function using the combination of va_arg, va_list, va_start and va_end. va_arg can give you each successive arguments in va_list.The list must be initialized by calling va_start() before any calls to va_arg(). The list must be finalized by calling va_end().

aspguy 11Feb2006 22:28

Re: (...) as the function input parameters.
 
Quote:

Originally Posted by aspguy
When i declare a function in C , with (...) in the input area, how do I refer to these variable in the function ??

I am still waiting for the reply from the Experts.

aspguy 11Feb2006 22:29

Re: (...) as the function input parameters.
 
Quote:

Originally Posted by coderzone
(...) in any function means that the function has variable no of parameters and so the parameters can be determined by the First parameter of the argument list. The best example of such function is printf.

You can get the argument passed to the function using the combination of va_arg, va_list, va_start and va_end. va_arg can give you each successive arguments in va_list.The list must be initialized by calling va_start() before any calls to va_arg(). The list must be finalized by calling va_end().

Ohh Thanks for the Reply Coderzone and probably we visited the thread almost at the same time and submitted the post just after you posted.

coderzone 11Feb2006 22:32

Re: (...) as the function input parameters.
 
Quote:

Originally Posted by aspguy
Ohh Thanks for the Reply Coderzone and probably we visited the thread almost at the same time and submitted the post just after you posted.

It Looks like.
Quote:

Originally Posted by aspguy
I am still waiting for the reply from the Experts.

Also you should give more than 3 and half hours for a reply.

aspguy 11Feb2006 22:33

Re: (...) as the function input parameters.
 
Quote:

Also you should give more than 3 and half hours for a reply.
Yeah I agree.


All times are GMT +5.5. The time now is 09:11.