I am facing a problem in c++:
#include <iostream>
class Apple{
public:
int price = 100;
enum class color {
red =1, green, yellow
};
};
int main() {
Apple apple;
std::cout << Apple::color::green << std::endl;
}
When I try to compile this code following message appears:
[Error] 'Apple::color' is not a class or namespace
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…