Advertisement
obernardovieira

Parse <info>char array,int,float</info>

Aug 5th, 2014
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5.     char sentence []="<info>come on,10,5.5</info>";
  6.     char a[10];
  7.     int b;
  8.     float c;
  9.  
  10.     sscanf (sentence,"<info>%[^','],%d,%f</info>",a, &b, &c);
  11.     printf("%s %d %f", a, b, c);
  12.  
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement