Created
July 4, 2018 10:11
-
-
Save thongntit/8b7d489430ffd14fb30fa1fa846bd836 to your computer and use it in GitHub Desktop.
Read string with format Applet read string with format
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
//gcc 5.4.0 | |
#include <stdio.h> | |
int main(void) | |
{ | |
char str[100] = "MemFree: 3226700 kB"; | |
char s1[50]; | |
char s2[50]; | |
sscanf(str,"%s%*[ ]%s",s1,s2); | |
strcmp(s1,"MemFree"); | |
{ | |
printf("%s",s1); | |
printf("%s",s2); | |
} | |
return 0; | |
} | |
/* | |
OUTPUT | |
MemFree:3226700 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment