Howdy~~
I get used to declaring everthing in 2 lines such as follows:
#include <iostream>
void main()
{
enum pet;
pet={dog,cat,bird,crocodile};
// I heard someone was fond of crocodile, aha~
pet myPet=dog;
cout << myPet << endl;
}
but the output report an error. it works fine when I rewrite the code like this:
#include <iostream>
void main()
{
enum pet{dog,cat,bird,crocodile};
pet myPet=dog;
cout << myPet << endl;
}
why couldnt we delare it in 2 different lines as before ???