actually I have a string from this type :
"1,Hello,E025FFDA,-126.56,52.34,true"
And I want to parse it using sscanf to store those value in variable of corresponding type so
uint, char[], maybe string here, ufloat ?, float, bool
I use sscanf with "%[^',']" format specifier and I test each value if it is correct or not and in a certain range.
Here is my code :
param is the pointer to the beginning of the string
temp2 a temporary variable
local_ptr is a copy of param to not modify param
RCV a struct with all my parameters
if((get_param_length(param) != 0) && (sscanf(local_ptr, "%[^',']", &temp2) == 1)){ RCV.binarypayload = temp2; } else { error = 1; }
Do you have any idea of the best type to store my values ? Or maybe advices ?
float- ForceBru%[^',']supposed to do? Do you mean%[^,]? - Gerhardh