home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_10
/
1010025a
< prev
next >
Wrap
Text File
|
1992-08-10
|
337b
|
19 lines
#include <stdio.h>
main()
{
char *s = "hello there 12345.67089";
char s1[6], s2[6], s3[6];
int n1, n2, nargs;
float f;
nargs = sscanf(s,"%20s%3s%s%3d%5f%d",
s1,s2,s3,&n1,&f,&n2);
printf("%d: %s,%s,%s,%d,%f,%d\n",
nargs,s1,s2,s3,n1,f,n2);
return 0;
}
Output
6: hello,the,re,123,45.669998,89