Valhalla Legends Forums Archive | C/C++ Programming | [c++] unlimited arguments to function

AuthorMessageTime
mentalCo.
hey i cant find this by googling so ill ask here.  say you have a function that goes like this:
[code]

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

[/code]

how do you access the variables passed after 'whatever'.
March 28, 2005, 4:33 PM
Myndfyr
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)
March 28, 2005, 5:40 PM
Arta
Look up va_list.
March 28, 2005, 7:25 PM
mentalCo.
thanks
March 28, 2005, 10:05 PM
St0rm.iD
or varargs
March 29, 2005, 12:42 AM

Search