Read formatted text into a character string.
Compatibility:This function is compatible with the following targets:
|
|
#include <stdio.h>
int sscanf(char *s, const char *format, ...);Parameters:
Parameters for this facility are:
For specifications concerning the input control string and conversion specifications see: "Input Control String and Conversion Specifiers." Also see "Scanset," for a full description of the use of scansets.
"Wide Character and Byte Character Stream Orientation"
Example of sscanf() usage.:#include <stdio.h>
int main(void)
{
static char in[] = "figs cat pear 394 road 16!";
char s1[20], s2[20], s3[20];
int i;
// get the words figs, cat, road,
// and the integer 16
// from in and store them in s1, s2, s3, and i,
// respectively
sscanf(in, "%s %s pear 394 %s %d!", s1, s2, s3, &i);
printf("%s %s %s %d\n", s1, s2, s3, i);
return 0;
}
Output:
figs cat road 16
[ 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