Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: denny_kurniawan on July 27, 2018, 12:00:21 pm

Title: Can't use enum, expected primary-expression before 'enum'
Post by: denny_kurniawan on July 27, 2018, 12:00:21 pm
I want to create enum inside my program
Code
int main(){
    enum opsi {ADD = 1, SHOW, EDIT, DELETE, EXIT};
    return 0;
}
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.
Title: Re: Can't use enum, expected primary-expression before 'enum'
Post by: stahta01 on July 27, 2018, 12:11:46 pm
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)