Valhalla Legends Archive

Programming => General Programming => C/C++ Programming => Topic started by: mentalCo. on March 28, 2005, 10:33 AM

Title: [c++] unlimited arguments to function
Post by: mentalCo. on March 28, 2005, 10:33 AM
hey i cant find this by googling so ill ask here.  say you have a function that goes like this:


void myFunction(char * whatever, ...){
}



how do you access the variables passed after 'whatever'.
Title: Re: [c++] unlimited arguments to function
Post by: MyndFyre on March 28, 2005, 11:40 AM
Googled "variable number of arguments in C".  You could have left out "of" and "in."

Came up with:
http://publications.gbdirect.co.uk/c_book/chapter9/stdarg.html
(9th result -- others may have been there, but this one looked best from the summary page)
Title: Re: [c++] unlimited arguments to function
Post by: Arta on March 28, 2005, 01:25 PM
Look up va_list.
Title: Re: [c++] unlimited arguments to function
Post by: mentalCo. on March 28, 2005, 04:05 PM
thanks
Title: Re: [c++] unlimited arguments to function
Post by: Banana fanna fo fanna on March 28, 2005, 06:42 PM
or varargs