News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

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

Started by denny_kurniawan, July 27, 2018, 12:00:21 PM

Previous topic - Next topic

denny_kurniawan

I want to create enum inside my program
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.

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]