Looking through MSVC's standard libraries, I see the function definition of printf() is:
printf(char const* const _Format, ...)
What does the 3 periods mean?
Looking through MSVC's standard libraries, I see the function definition of printf() is:
printf(char const* const _Format, ...)
What does the 3 periods mean?
That defines the function as a Variadic Function
(variable arguments) meaning it is a function which can take any number of arguments. This is useful for functions like printf
since there is no way to determine how many arguments might be passed in
printf("%d %d", 5, 5); // two args
printf("%d %d %d", 5, 5, 5); // three args
This is just a feature of the language that allows you to pass any number of arguments to a function. Without this feature, the user would need to gather each desired parameter into an array beforehand, and pass them as a single parameter.