How To Fix This error

lieweffect's Avatar, Join Date: Apr 2006
Contributor
I have compile a program, below is a part of the code:
typedef enum{false,true}boolean;
But after compile it give me the following error

expected identifier before "false"
expected "}" before "false"
expected unqualified-id before "false"
expected ',' or ';' before "false"
expected declaration before "}" token.


I'm using the Dev-C++ to compile
Can anybody help me.Thank You

Last edited by lieweffect; 21Apr2006 at 10:44..
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
typedef enum{false,true}boolean; means you are assigning value 0 to the false and 1 to true but it might so happen that its predefined for the compiler.
0
lieweffect's Avatar, Join Date: Apr 2006
Contributor
Then how do I fix it?
Thank You
I attached together with the code.
If possible could you fix it and make an execute program to me
Thank You
Attached Files
File Type: txt code.txt (13.3 KB, 10 views)
0
coderzone's Avatar, Join Date: Jul 2004
Team Leader
Just try replacing it with typedef enum{_false_,_true_}_boolean_; and see if it compiles or there are some more errors somewhere else.
0
lieweffect's Avatar, Join Date: Apr 2006
Contributor
Quote:
Originally Posted by coderzone
Just try replacing it with typedef enum{_false_,_true_}_boolean_; and see if it compiles or there are some more errors somewhere else.
cannot, after replace the code, there have lot of errors

Last edited by lieweffect; 21Apr2006 at 14:51..
0
coderzone's Avatar, Join Date: Jul 2004
Team Leader
What are the errors coming.
0
lieweffect's Avatar, Join Date: Apr 2006
Contributor
Quote:
Originally Posted by coderzone
What are the errors coming.
I have upload the code.You try to have a look
0
coderzone's Avatar, Join Date: Jul 2004
Team Leader
Quote:
Originally Posted by lieweffect
I have upload the code.You try to have a look
I use VC++ compiler and it does not support lots of functions. like clrscr,gotoxy but after removing them and replacing the boolean with the necessary code I succesfully compiled it.
0
lieweffect's Avatar, Join Date: Apr 2006
Contributor
Quote:
Originally Posted by coderzone
I use VC++ compiler and it does not support lots of functions. like clrscr,gotoxy but after removing them and replacing the boolean with the necessary code I succesfully compiled it.
Could you make an exe. file and send the code together to me.Thank You
My e-mail: lieweffect@yahoo.com
0
coderzone's Avatar, Join Date: Jul 2004
Team Leader
GMail does not allow me to upload exe files and I have renamed it to g4e file. Please rename it to exe file.