Format a character string array.
Compatibility:This function is compatible with the following targets:
|
|
#include <stdio.h>
int sprintf(char *s, const char *format, ...);Parameters:
Parameters for this facility are:
For specifications concerning the output control string and conversion specifiers please see: "Output Control String and Conversion Specifiers."
Return:
sprintf() returns the number of characters assigned to s, not including the null character.
"Wide Character and Byte Character Stream Orientation"
Example of sprintf() usage.:#include <stdio.h>
int main(void)
{
int i = 1;
static char s[] = "Metrowerks";
char dest[50];
sprintf(dest, "%s is number %d!", s, i);
puts(dest);
return 0;
}
Output:
Metrowerks is number 1!
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000