11.07.2015 Views

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

vscanf returns the value of the macro EOF if an input failure occurs be<strong>for</strong>e anyconversion. Otherwise, vscanf returns the number of input items assigned, which canbe fewer than provided <strong>for</strong>, or even zero, in the event of an early matching failure.NotesPortabilityvscanf is equivalent to scanf with the variable argument list replaced by arg.vscanf con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).See Also Formatted input control strings (page 285)vsnprintfSynopsisDescriptionNotesPortability#include int vsnprintf(char *s, size_t n, const char *<strong>for</strong>mat, va_list arg);vsnprintf writes to the string pointed to by s under control of the string pointed to by<strong>for</strong>mat that specifies how subsequent arguments are converted <strong>for</strong> output. Be<strong>for</strong>ecalling vsnprintf, arg must be initialized by the va_start macro (and possiblysubsequent va_arg calls). vsnprintf does not invoke the va_end macro.If n is zero, nothing is written, and s can be a null pointer. Otherwise, output charactersbeyond the n-1st are discarded rather than being written to the array, and a nullcharacter is written at the end of the characters actually written into the array. A nullcharacter is written at the end of the conversion; it is not counted as part of the returnedvalue.If there are insufficient arguments <strong>for</strong> the <strong>for</strong>mat, the behavior is undefined. If the<strong>for</strong>mat is exhausted while arguments remain, the excess arguments are evaluated butare otherwise ignored.If copying takes place between objects that overlap, the behavior is undefined.vsnprintf returns the number of characters that would have been written had n beensufficiently large, not counting the terminating null character, or a negative value if anencoding error occurred. Thus, the null-terminated output has been completelywritten if and only if the returned value is nonnegative and less than n.vsnprintf is equivalent to snprintf with the variable argument list replaced by arg.vsnprintf con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).See Also Formatted output control strings (page 281)vsprintfSynopsis#include int vsprintf(char *s, const char *<strong>for</strong>mat, va_list arg);Chapter 28 - Input/output functions293

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!