I wrote in C function:
void func(int count,bool infini){
//...
}
I try compile this code with Code Blocks, (GCC) spike:
“expected declaration specifiers or ‘…’ before bool”
.
Where is bug?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Chances are that you are compiling in C mode. C does not have
bool. Useintinstead or includestdbool.hto get a#defineofbool(only C99) or create a typedef /#defineyourself (if your compiler doesn’t have or you don’t want to usestdbool.h. But GCC provides this header).Alternatively in C99 code you can use
_Boolinstead (which is a keyword in C99, much likeboolis to C++), but take in mind that C99 is not widely supported.