Hi;
I tried to do tht.With a character to take in the '?'.But as u see it occures only some times.And sscanf() ignores the spaces.
So its possible tht the value comes in 2 ways.
Code:
READOUT " -0.01 V, -0.04 A" /n
Code:
READOUT "? -0.01 V, -0.04 A" /n
So I changed the format of the program to
Code:
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
double x, y;
char a, b,c;
char buff[] = "READOUT \" -0.01 V, -0.04 A\" \n";
if(sscanf(buff, "READOUT \" %c %lf %c, %lf %c",&c, &x, &a, &y, &b) == 5)
{
printf("Success: %f %c %f %c\n", q,x, a, y, b);
}
return 0;
}
But so the variable q can be used to check if its a blank or "?".But it doesnt work.Could you please look through this?
Regards