Im struggling with my program atm
Im trying to get this to work:
char *p = 'A';
char inputs[AR_SIZE];
char userChars[4];
double *userNums[3] = {0,0,0};
while (p != 'Z') {
gets(inputs);
p = inputs[0];
if (!charEval(inputs)) {
printf("%s", error1);
}
//Zero Terminates String
inputs[strlen(inputs)] = "\0";
//Checks to see if all fields are fufilled
if (sscanf(inputs, "%3s %lf %lf %lf", userChars, &userNums, &userNums[1], &userNums[2]) != 4) {
printf("%s", error1);
}
else {
sscanf(inputs, "%3s %lf %lf %lf", userChars, userNums, &userNums[1], &userNums[2]);
printf("%lf", userNums);
}
-This program is intended to force users to follow a format string indicated in sscanf
-My issue is that it is not reading any numbers in on the else statment, it will always make each value zero
-I have no clue what im doing wrong, the eval string is "CCC Num Num Num", it should be working