0

I found the following code in a cpp files of the ImGui library. What does this signature mean in C++ please:

void ImGui::Text(const char* fmt, ...);

Is this a type of parameter pack which looks different:

template<class... Args>
void op(Args... args);
Vero
  • 313
  • 2
  • 9
  • 2
    The is just a [`variadic function`](https://en.cppreference.com/w/cpp/utility/variadic). Nothing to do with parameter packs or templates. Should be a dupe somewhere. – G.M. Aug 27 '22 at 11:40
  • 1
    It is a [variadic function](https://en.cppreference.com/w/cpp/utility/variadic) (not to be confused with _variadic template_ which is completely unrelated). It is a C feature actually, a function accepting an unspecified number of arguments of unspecified type. It is how `printf` etc. work. The function probably just forwards to `sprintf`. Except for interfacing with C there is basically no good reason to use variadic functions in C. They are pretty dangerous because there is no type safety on the arguments at all. – user17732522 Aug 27 '22 at 11:41

0 Answers0