Skip to content

Instantly share code, notes, and snippets.

@thongntit
Created July 4, 2018 10:11
Show Gist options
  • Save thongntit/8b7d489430ffd14fb30fa1fa846bd836 to your computer and use it in GitHub Desktop.
Save thongntit/8b7d489430ffd14fb30fa1fa846bd836 to your computer and use it in GitHub Desktop.
Read string with format Applet read string with format
//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