How do I use variable-arguments (varargs) in C++ (effectively)?

So, C++ extends C, and as that being the case, the implementation of varargs persisted (and hasn’t changed, since it could break already existing code).

In C, you could do #include <stdarg.h>, which included some functions for navigating the arg…


This content originally appeared on DEV Community and was authored by Calin Baenen

So, C++ extends C, and as that being the case, the implementation of varargs persisted (and hasn't changed, since it could break already existing code).

In C, you could do #include <stdarg.h>, which included some functions for navigating the arguments.
But now most of C's original .h files are deprecated (in C++).
So I'm wondering, what's the effective way of using varargs in C++?


This content originally appeared on DEV Community and was authored by Calin Baenen


Print Share Comment Cite Upload Translate Updates
APA

Calin Baenen | Sciencx (2021-12-04T23:13:29+00:00) How do I use variable-arguments (varargs) in C++ (effectively)?. Retrieved from https://www.scien.cx/2021/12/04/how-do-i-use-variable-arguments-varargs-in-c-effectively/

MLA
" » How do I use variable-arguments (varargs) in C++ (effectively)?." Calin Baenen | Sciencx - Saturday December 4, 2021, https://www.scien.cx/2021/12/04/how-do-i-use-variable-arguments-varargs-in-c-effectively/
HARVARD
Calin Baenen | Sciencx Saturday December 4, 2021 » How do I use variable-arguments (varargs) in C++ (effectively)?., viewed ,<https://www.scien.cx/2021/12/04/how-do-i-use-variable-arguments-varargs-in-c-effectively/>
VANCOUVER
Calin Baenen | Sciencx - » How do I use variable-arguments (varargs) in C++ (effectively)?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/12/04/how-do-i-use-variable-arguments-varargs-in-c-effectively/
CHICAGO
" » How do I use variable-arguments (varargs) in C++ (effectively)?." Calin Baenen | Sciencx - Accessed . https://www.scien.cx/2021/12/04/how-do-i-use-variable-arguments-varargs-in-c-effectively/
IEEE
" » How do I use variable-arguments (varargs) in C++ (effectively)?." Calin Baenen | Sciencx [Online]. Available: https://www.scien.cx/2021/12/04/how-do-i-use-variable-arguments-varargs-in-c-effectively/. [Accessed: ]
rf:citation
» How do I use variable-arguments (varargs) in C++ (effectively)? | Calin Baenen | Sciencx | https://www.scien.cx/2021/12/04/how-do-i-use-variable-arguments-varargs-in-c-effectively/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.