News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

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]