Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   How To Fix This error (http://www.go4expert.com/forums/fix-error-t748/)

lieweffect 21Apr2006 10:20

How To Fix This error
 
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

shabbir 21Apr2006 10:59

Re: How To Fix This error
 
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.

lieweffect 21Apr2006 12:14

Re: How To Fix This error
 
1 Attachment(s)
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

coderzone 21Apr2006 14:30

Re: How To Fix This error
 
Just try replacing it with typedef enum{_false_,_true_}_boolean_; and see if it compiles or there are some more errors somewhere else.

lieweffect 21Apr2006 14:39

Re: How To Fix This error
 
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

coderzone 21Apr2006 16:50

Re: How To Fix This error
 
What are the errors coming.

lieweffect 21Apr2006 18:29

Re: How To Fix This error
 
Quote:

Originally Posted by coderzone
What are the errors coming.

I have upload the code.You try to have a look

coderzone 21Apr2006 20:22

Re: How To Fix This error
 
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.

lieweffect 21Apr2006 20:26

Re: How To Fix This error
 
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

coderzone 21Apr2006 20:33

Re: How To Fix This error
 
GMail does not allow me to upload exe files and I have renamed it to g4e file. Please rename it to exe file.


All times are GMT +5.5. The time now is 17:54.