Code that works in my PC in C but not in Arduino

Hello,

I have a santence that works in C with my computer but not with Arduino. The function is sscanf. This is the code:
char GPS_lat[15];
int lat;
float latmin;
char NS;
//And in the loop
sscanf(GPS_lat, "%2d%f,%c", &lat, &latmin, &NS);
//GPS_lat is: 4029.7574,N
With the compiler in my computer I have 40 in lat, 29.7574 in latmin and N in NS. But with Arduino I only have 40 in lat, but latmin=0.000000 and NS has nothing. In Arduino I think sscanf does not work with floats or chars. I think it could be becouse of the library stdio.h, function sscanf does not work like in other compilers.

¿How can I solve this problem? I need the value in lat, latmin and NS.

Thank you very much.

This function takes the input from a data stream, normally a keyboard, and puts it into variables.

As you have found out there is not the same function on the arduino. Mainly because there is no keyboard. To get variables values in you normally have to go through the serial monitor and write the equivalent function from the basic Serial.read.

sscanf(GPS_lat, "%2d%f,%c", &lat, &latmin, &NS);

The %f format is not supported on the Arduino. You could scan the string for the part before the decimal point and the part after the decimal point, as two integers, and use them to reconstruct the float. If you use "%d.%2d", &latInt, &latDec, latDec will be a 2 digit (or less) integer value. lat = latInt + latDec/100.

Thank you very much. I could dolve the problem.