Hi I am having problems compiling this program they are 3 errors in line 7. Can you help me find the problem?
Thanks for your help.
boolean.c(7) : error C2065: 'Bool' : undeclared identifier
boolean.c(7) : error C2146: syntax error : missing ';' before identifier 'input_is_good'
boolean.c(7) : error C2065: 'input_is_good' : undeclared identifier
Error executing cl.exe.
Code:
// boolean.c -- using a _Bool variable
#include <stdio.h>
int main(void)
{
long num;
long sum = 0L;
_Bool input_is_good; //where the error is
printf("Please enter an integer to be summed. ");
printf("Enter q to quit.\n");
input_is_good = (scanf("%ld", &num) == 1);
while (input_is_good)
{
sum = sum + num;
printf("Please enter next integer to be summed. ");
printf("Enter q to quit.\n");
input_is_good = (scanf("%ld", &num) == 1);
}
printf("Those integers sum to %ld.\n", sum);
return 0;
}