home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_09
/
1009114a
< prev
next >
Wrap
Text File
|
1992-07-13
|
591b
|
34 lines
#include <stdio.h>
#include <stdlib.h>
char *string[] = {
"some garbageR A 3 4",
"R A 3 0 4"
};
const char *format = "%*[^PR]%c %c %d %d %d";
void main(void);
void main(void)
{
int ret;
int i;
int k=0, n=0, m=0;
char 1=0, q=0;
for (i=0; i<2; i++)
{
ret = sscanf (string[i], format, &1, &q, &k, &m, &n);
if (ret !=5)
{
printf ("SSCANF FAIL string[%d]!\n", i);
}
else
{
printf ("SSCANF OK string[%d]!\n", i);
}
}
}