About 51 results
Open links in new tab
  1. variadic functions - Variable number of arguments in C++ ... - Stack ...

    505 In C++11 you have two new options, as the Variadic arguments reference page in the Alternatives section states: Variadic templates can also be used to create functions that take variable number of …

  2. c++ - Variadic templates - Stack Overflow

    Sep 3, 2010 · variadic templates (accepting an arbitrary number of parameters) The purpose of the variadic member template is to forward arguments to the object referred to by ptr.

  3. Variadic templates in C++ and how they work - Stack Overflow

    May 28, 2020 · The variadic template makes the compiler generate all of these "on demand" and saves you from writing them all out. One way to look at it is that regular function templates (with only type …

  4. Technically, how do variadic functions work? How does printf work?

    Apr 16, 2014 · I know I can use va_arg to write my own variadic functions, but how do variadic functions work under the hood, i.e. on the assembly instruction level? E.g., how is it possible that printf takes a

  5. How to define variadic **argv in C function - Stack Overflow

    Sep 16, 2025 · The helper function foo_3 is created for the case of a single string argument, which delegates to foo_2 with the added NULL. Using a distinguishing sentinel value is also an idiomatic …

  6. How to make a variadic macro (variable number of arguments)

    How to make a variadic macro (variable number of arguments) Asked 16 years, 10 months ago Modified 2 years, 7 months ago Viewed 287k times

  7. Specifying one type for all arguments passed to variadic function or ...

    Specifying one type for all arguments passed to variadic function or variadic template function w/out using array, vector, structs, etc? Asked 15 years, 5 months ago Modified 1 year, 1 month ago …

  8. C - Function with Variadic Arguments - Stack Overflow

    Jan 17, 2022 · Average of 2, 3, 4, 5 = 3.500000 Average of 5, 10, 15 = 10.000000 Read more in Variadic Functions in C and the Reference. Tip: Think twice before using Variadic functions. As …

  9. How to create a variadic generic lambda? - Stack Overflow

    Sep 17, 2014 · auto variadic_generic_lambda = [] (auto&&... param) {}; Usage How do you use the parameters ? You should consider the variadic generic parameter as having a template parameter …

  10. How to assign variadic/variable arguments in C++

    Feb 21, 2022 · That beeing set, variadic arguments are a very unsafe way of passing variables. In your example, if someone changes the type of a, b, and c to another type, you will run into serious …