
#include <stdio.h> 
#include <string.h>

int main() {
char buf[1000] = "(see 590 ((f c t) 27.1 6) ((f r t) 79.8 2) ((f r b) 106.7 42) ((f g r b) 90.9 29) ((g r) 87.4 25) ((f g r t) 84.8 21) ((f p r b) 84.8 42) ((f p r c) 73 30) ((f p r t) 65.4 15) ((f t 0) 27.1 -4 0 0) ((f t r 10) 37 -3) ((f t r 20) 47 -2) ((f t r 30) 56.8 -2) ((f t r 40) 67.4 -2) ((f t r 50) 76.7 -1) ((f t l 10) 17.1 -7 0 0) ((f t l 20) 7.3 -16 0 0) ((f b r 50) 107.8 45) ((f r 0) 91.8 24) ((f r t 10) 89.1 18) ((f r t 20) 86.5 11) ((f r t 30) 84.8 5) ((f r b 10) 96.5 29) ((f r b 20) 101.5 34) ((f r b 30) 107.8 38))";

//char * str2 = new char[1000];
char * str = strstr(buf, "(g r)");
int i = -1; 
float fl = -1; 
sscanf(str, "(g r) %f %d)", &fl, &i); // The integer value appeared at the place of the %d would go to the i variable. 
printf("i:%d dbl:%f\n", i, fl); //for testing

}
