Do you always get 4 lines of data? Is the data of interest always on the last line? Are there always 3 values?
Parsing data is a complex process. Finding the data of interest is the hardest part. If you know that the data of interest is always on the last line, and you've stored that data in an array of chars, sscanf is the correct function to use to separate it into discrete values.
The function takes 3 or more arguments. The first is the string to parse. The second is the parse format statement. It would look like this to parse three ints: "%d,%d,%d". The remaining argument(s) are the variables to populate with the values parsed.
Split the string with numbers into 3 separate strings (look for "," character in for cycle) and convert them into numbers (atoi, atol, atof ... functions in C).
The variables temp1, temp2, and sun need to be defined as int.
You probably want to do something with the values after you get them. The function shown does not, so unless they are global variables, the data will be lost when the function ends.
The while statement is missing a closing ). The variables i and data are not defined here, so whether or not the while makes sense, or not, is unknown to us.
The string = string[]++; statement contains many errors. Without knowing what string is, and what you meant to do, I can not suggest a correct statement.