I am self teaching myself in C++ so I just would like to ask for your forgiveness if my question is really basic.
I am following a tutorial on www.learncpp.com
According to the tutorial, I could define my c++ array such as like this
int main()
{
using namespace std;
enum ArrayElements
{
MAX_ARRAY_SIZE = 5;
};
int anArray[MAX_ARRAY_SIZE];
return 0;
}
But codeblock keep on issuing error
||=== Build: Debug in CH6 (compiler: GNU GCC Compiler) ===|
In function 'int main()':|
|6|error: expected primary-expression before 'enum'|
error: expected ';' before 'enum'|
||=== Build failed: 2 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|
I just dont know what is causing the error or is there a problem with the tutorial I am following?