Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "123 35 123 0 0 0 817 0 0 0 0"
- int a, b, c;
- if( sscanf(string, "%d %d %d", &a, &b, &c) == 3)
- printf("the third number is %dn", c);
- int a;
- if( sscanf(string, "%*d %*d %d", &a) == 1)
- printf("the third number is %dn", a);
- const char *input = "...";
- int value;
- // here we use the '*' modifier to discard the input from our string
- sscanf("%*i %*i %i", &value);
- // value now magically has the value you need.
Add Comment
Please, Sign In to add comment