Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > How to use a function with variable number of arguments

Reply
Thread Tools

How to use a function with variable number of arguments

 
 
EricLin
Guest
Posts: n/a
 
      02-06-2004
Dear all:

I am just concerned about how to use a function with variable number
of arguments. for example:

int TestFunction(arguments)
{
....
Testing contents...
}

The number of arguments will change every time I call TestFunction().

Thanks.

Yuncheng
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Ed Morton
Guest
Posts: n/a
 
      02-06-2004


EricLin wrote:
> Dear all:
>
> I am just concerned about how to use a function with variable number
> of arguments. for example:
>
> int TestFunction(arguments)
> {
> ...
> Testing contents...
> }
>
> The number of arguments will change every time I call TestFunction().
>
> Thanks.
>
> Yuncheng
> (E-Mail Removed)


Read the FAQ on variable length arguments:

http://www.eskimo.com/~scs/C-faq/s15.html

and the relevant chapter of your C book then come back if you have any
questions.

Ed>

 
Reply With Quote
 
 
 
 
E. Robert Tisdale
Guest
Posts: n/a
 
      02-06-2004
EricLin wrote:

> I am just concerned about how to use a function
> with variable number of arguments. for example:
>
> int TestFunction(arguments) {
> ...
> Testing contents...
> }
>
> The number of arguments will change every time I call TestFunction().


It's a Frequently Answered Question (FAQ)
15. Variable-Length Argument Lists

http://www.eskimo.com/~scs/C-faq/s15.html

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Calling a function that expects variable arguments from a functionwith variable arguments Navaneeth C Programming 4 11-20-2010 05:35 AM
Call again a variadic function (... variable number of arguments)with same arguments that its variadic wrapper moreau.steve@gmail.com C Programming 3 12-31-2008 07:13 AM
how to pass a function name and its arguments inside the arguments of other function? jmborr Python 1 11-03-2007 08:20 AM
variable number of arguments + function pointers Alex C++ 1 10-16-2003 10:31 PM



Advertisments