In the future, please indicate the exact error message from the compiler, as well as a description of which development environment you are using (Visual Studio, Eclipse, gcc, tcc, lcc-win, etc.). It will also help you find out which book you are using; non-trivial number of books on programming in C shit .
My suspicion is that you are somehow compiling the code as C ++, not C, and bool is a reserved word in C ++. If you are using Visual Studio, make sure that the file name extension is .c and not .cpp .
source share