Doom9
31st May 2005, 18:01
it's been ages since I've used C the last time (not my favorite language really.. no objects, pointers, ugh). Anyway, I need to parse a string in the format "integer, char, double"
int start;
double value;
char mode;
int e = sscanf(p, "%d,%c,%f", &start, &mode, &value);
int q = (int)(value * 100);
Suppose my double is 20... q ends up a huge number. I'm doing this blindly (no development environment) so all I have to go by is a C reference that tells me %f converts to a floating point number.
int start;
double value;
char mode;
int e = sscanf(p, "%d,%c,%f", &start, &mode, &value);
int q = (int)(value * 100);
Suppose my double is 20... q ends up a huge number. I'm doing this blindly (no development environment) so all I have to go by is a C reference that tells me %f converts to a floating point number.