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

denny_kurniawan

  • Guest
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
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: 7592
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org