I have a question about this fragment of code I wrote in C:
printf("Do you own a microwave?Enter 1 for Yes and 0 for No\n");
while((scanf("%d",µw))==0){
printf("Please enter a valid number:\n");
scanf("%d",µw);}
My compiler says the following: "format %d
expects argument of type int*
but argument 2 has type _Bool*
". As far as I am informed, boolean was considered an int type so I am not sure why this warning is received. How else would I be able to test for this condition other than to set up another variable to test with scanf
, and then assigning another variable of _Bool
type to true or false? Any feedback is appreciated. I thank you all :).