I was wondering if the below function prototype is valid. It compiled fine, but the three period is kinda throwing me off and I couldn't find anything similar on Google.
void foo(int, ...);
Thanks!
I was wondering if the below function prototype is valid. It compiled fine, but the three period is kinda throwing me off and I couldn't find anything similar on Google.
void foo(int, ...);
Thanks!
Yes, it's valid. In this example, ...
creates a variadic function using the va_list
mechanism. This is how variadic functions are implemented in C, and to some degree in C++ (though C++11's template parameter packs have rendered this mechanism obsolete).
Further reading: va_arg