Author Topic: Can't use enum, expected primary-expression before 'enum'  (Read 150 times)

Offline denny_kurniawan

  • Single posting newcomer
  • *
  • Posts: 1
Can't use enum, expected primary-expression before 'enum'
« on: July 27, 2018, 12:00:21 pm »
I want to create enum inside my program
Code: [Select]
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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6280
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org