Talk:c/io/fprintf

snprintf(0,0,format,...) seems correct and used to know the required buffer size
In this page and also in C++ documentation, the specific usage of  and   is not documented.

I have done some testing on coliru using compilation options  (see above snippet).

But I do not know if this is a standard. I have read on stackoverflow that on Windows, this does not work and the recommended way is to use ...

Do you agree if I update the documentation?

--Oli (talk) 08:45, 20 February 2015


 * yes, this is standard behavior, and this page currently mentions it by stating that returns "number of characters (not including the terminating null character) which would have been written to buffer if bufsz was ignored". I'll add a note. --Cubbi (talk) 08:54, 20 February 2015 (PST)


 * Hi Cubbi, your edit is fine.
 * However I am sorry for having suggested the line  
 * This is the Variable Length Array standardized in C99 BUT not (yet?) in C++.
 * The VLA was planned to be introduced in C++14 as Runtime-sized arrays with automatic storage duration but has been out-scoped because of lack of runtime computation of  
 * VLA maybe or not introduced in C++17
 * Therefore I try to think about an alternative C++ compliant as  
 * What do you think?  Oli (talk) 05:28, 26 February 2015 (PST)
 * The line is used on a C language reference page, not on the C++ language reference page. --Cubbi (talk) 06:25, 26 February 2015 (PST)