What does ... mean in a fuction parameter list like
Code:void test(int temp2, ...);
What does ... mean in a fuction parameter list like
Code:void test(int temp2, ...);
You can also take advantage of this in your own functions thanks to stdarg.h (or <cstdarg> as it is in c++)
Code:#include <iostream> #include <cstdarg> using namespace std; void ToScreen(int nNoArg,...){ va_list args;//list of arguments va_start(args,nNoArg);//start point for(int i = 0;i < nNoArg;++i)//print each cout << va_arg(args,int) << endl; va_end(args);//end } int main(){ //first arg says how many args to follow ToScreen(4,1,2,3,4); }
k, se you point here.
Almost nothing. I´ve one of thoose who started with c++ before c and I´m always using the cout object.Have you ever used printf() at all (in stdio.h)?
Is this the only way you use ... or there other combinations?? E.i like
I´ve tried t obtain more information about this but I don´t really know how to search it .Code:void tmp(...);