Talk:Stdarg.h

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Becoming a manual page?[edit]

This article seems to be a tutorial or manual page. I question the need for this page to exist at all. 75.119.90.35 (talk) 18:05, 24 October 2013 (UTC)[reply]

Untitled[edit]

C++

> though permitted, is deprecated in C++.

So what are the alternatives to in C++ ? --RzR 13:13, 3 December 2007 (UTC)[reply]

Using <cstdarg>. Eric119 00:43, 4 December 2007 (UTC)[reply]

Damm useful page! :) —Preceding unsigned comment added by 210.212.160.101 (talk) 07:08, 12 March 2009 (UTC)[reply]

Infinite number of arguments[edit]

Shouldn't that be "arbitrary number of arguments"? You can't even create a call containing an infinite number of arguments, much less execute that call. —Preceding unsigned comment added by 79.120.193.114 (talk) 14:18, 24 November 2009 (UTC)[reply]

Varg pass-through[edit]

Is it possible for a varg function to process a couple of args, then pass the tail of the varg list through to another varg function? It would be useful to discuss that case. — MaxEnt 19:33, 14 June 2010 (UTC)[reply]

Terminating with -1[edit]

I was wrong: this example shows the use of -1 as an end-of-args marker, whereas the man page example (man stdarg) just keeps pulling arguments as long as more of them are demanded by the format string, the same as printf does, which is why there is no need for an end-of-args marker value. But I still think i >= 0 is a better test than i != -1. —Preceding unsigned comment added by 72.208.148.56 (talk) 00:23, 15 October 2010 (UTC)[reply]

Should we add gcc and clang's sentinel attribute?[edit]

Should we add __attribute__((sentinel))? It checks that the parameter list ends in NULL. Allen Me (talk) 15:34, 19 November 2016 (UTC)[reply]

vsprintf or vsnprintf?[edit]

In this article it states the following. Which is it?

To call other var args functions from within your function (such as sprintf) you need to use the var arg version of the function (vsprintf in this example):

void MyPrintf(const char *format, ...) {

 va_list args;
 char buffer[BUFSIZ];
 va_start(args, format);
 vsnprintf(buffer, sizeof buffer, format, args);
 va_end(args);
 FlushFunnyStream(buffer);

}

What is FlushFunnyStream?[edit]

At the end of the example for MyPrintf, a function is called FlushFunnyStream(buffer). When looking this up, only sites using this example come up. What is this function supposed to mean? KawaiiAmber (talk) 09:14, 2 February 2022 (UTC)[reply]