#include /* C example */ #include int main(int argc, char **argv) { const char a[] = "size 38L"; char word[100]; int i; char c; if (sscanf(a, "%s%d%c", word, &i, &c) != 3) { fprintf(stderr, "%s: sscanf failed\n", argv[0]); return EXIT_FAILURE; } printf("word == \"%s\"\n", word); printf("i == %d\n", i); printf("c == '%c'\n", c); return EXIT_SUCCESS; }