can you give an example of the type of string this would be? is it space seperated?
In C there are no strings, just char arrays or char *'s which are the equivilant to a string.
I need a quick refresher on some C commands that act on strings or char arrays ... what I have is a GPS unit connected to my machine, and I want to manipulate some of the raw NEMA data ... can anyone help me on what C commands to use for the following:
Assuming that the data from the GPS comes as a char array (or a string, but i'm almost certain a char array), i want to create a data structure that parses the data ... the data is deliminated by field, i.e.:
<location><direction><velocity>& lt;etc...>
is what will be passed to me ... now, given that its a char array, how do i extract these specific values? Assume that the location field contains to floats, and that the direction and velocity are doubles.
I know this C functions exist for this, I'm just not familiar with them, thanks!
can you give an example of the type of string this would be? is it space seperated?
In C there are no strings, just char arrays or char *'s which are the equivilant to a string.
something like that wrote it quick prolly some semantic faults.Code:int parseIndex,start,end,tempParse,indexCounter; for(parseIndex=0;parseIndex < MAX_PARSE_ARR || arr[parseIndex]!='\0';parseIndex++) { if(arr[parseIndex]=='.'&&arr[parseIndex+1]==':') { start=parseIndex; for(tempParse=parseIndex+1;arr[tempParse]!='.'&&arr[tempParse+1]!=':';tempParse++) slut=tempParse; indexCounter++; getData(start,slut,indexCounter); } }
[edit:gorn]added code tags[/edit]
Bookmarks