Created
February 23, 2012 05:17
-
-
Save Wollw/1890495 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
char s1[256],s2[256],s3[256]; | |
int i; | |
sscanf("MPTRAY=FIRST [3 ENUMERATED READONLY]", | |
" %s [%d %s %s]", | |
s1, &i, s2, s3); | |
s3[strlen(s3) - 1] = '\0'; | |
printf("%s\n%d\n%s\n%s\n", s1, i, s2, s3); | |
} | |
/* | |
~$ ./a.out | |
MPTRAY=FIRST | |
3 | |
ENUMERATED | |
READONLY | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment