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.

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.snprintf 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.Portabilitysnprintf 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)sprintfSynopsisDescriptionPortability#include int sprintf(char *s, const char *<strong>for</strong>mat, ...);sprintf 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. A nullcharacter is written at the end of the characters written; it is not counted as part of thereturned value.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.sprintf returns number of characters transmitted (not counting the terminating null),or a negative value if an output or encoding error occurred.sprintf 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)sscanfSynopsis#include int sscanf(const char *s, const char *<strong>for</strong>mat, ...);Chapter 28 - Input/output functions291

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

Saved successfully!

Ooh no, something went wrong!