The compiler throws an 'unused variable error', when I try to declare any type of variable and assign it a value. Below I use 'float' as the variable type and try and assign it to 1.5.
#include <stdio.h>
#include <cs50.h>
int main(void)
{
printf("How long is your shower?\n");
int time = GetInt();
float flow = 1.5;
}
The compiler throws this error:
~/workspace/pset1/ $ make water
clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow water.c -lcs50 -lm -o water
water.c:10:11: error: unused variable 'flow' [-Werror,-Wunused-variable]
float flow = 1.5;
^
1 error generated.
make: *** [water] Error 1