-2

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!

Quentin
  • 62,093
  • 7
  • 131
  • 191

1 Answers1

4

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

cdhowie
  • 158,093
  • 24
  • 286
  • 300