Namespaces
Variants
Actions

Talk:cpp/utility/variadic/va arg

From cppreference.com

In the description for calling va_arg() when no more values are available, it says: "the behavior is undefined, unless ..." then the two cases are listed for which the behavior is defined. But it does not say, what the defined behavior actually is (return 0/NULL pointer, I guess?). Gemini67 (talk) 07:40, 27 April 2017 (PDT)

these are not the exceptions for "when no more arguments", these are the exceptions for incompatible types. I'll break up that paragraph. --Cubbi (talk) 08:14, 27 April 2017 (PDT)

[edit] Using count in the example

IMHO, the example is not ideal. It calls va_start(args, count), which looks much like count is the number of arguments passed, which is not the case. count is just the last parameter. Maybe the example could be updated to take a string as additional argument, so that va_start(args, s) needs to be used. This way people might wonder how va_start() works and read that documentation, too. --89.245.45.244 00:15, 14 December 2022 (PST)

I agree. Changed accordingly ✔ --Ybab321 (talk) 04:00, 14 December 2022 (PST)