I’m quite unfamiliar with C. A comma sepearted string comes in and I need to untangle it. Some bits correspond to numerical values, others to words etc.
Input
char str_in;
str_in = "$GPRMC,114353.000,A,6016.3245,N,02458.3270,E,0.01,0,A*69";
Output
#include <string.h>
float lat, lon, time;
time = 114353.000;
lat = 60+(1/60)*16.3245; //Conversion to decimal degrees
lon = 024+(1/60)*58.3270;
All the spacings remain unchanged. The section I have struggled with is extracting the first two/three digits from the latitude/longitude and treating them differently. Can anyone help?
Uses strtok. Here’s a reference:
http://www.metalshell.com/source_code/31/String_Tokenizer.html