mercredi 26 avril 2017

Seeking explainers on C++11 printf format args that consume more than one value

I have started working in a code base heavily using C++11. I am finding many resources to help me learn, but I can't find any mention of a type of printf format string I am seeing used:

printf( "%.*s", integerValue, charPointer );

I think I know what it is doing: the integerValue is the length of the character buffer. However, my decades of C/C++ tells me that is a single argument specification in the format string, yet it consumes two values after the format string.

Where is this newfangled behavior documented? Are there more multiple-value consuming printf format args like this? I've been searching printf format string documentations, and finding nothing.

Aucun commentaire:

Enregistrer un commentaire