User forums > Using Code::Blocks

Can't use enum, expected primary-expression before 'enum'

(1/1)

denny_kurniawan:
I want to create enum inside my program

--- Code: ---int main(){
    enum opsi {ADD = 1, SHOW, EDIT, DELETE, EXIT};
    return 0;
}
--- End code ---
but when i try to compile, the IDE says expected primary-expression before 'enum'. How to solve this?
when i use another IDE like vc++ its work.
thanks in advance.

stahta01:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Navigation

[0] Message Index

Go to full version