class TElementField
{
public:
int state;
};
class TOperator
{
TElementField Fields[10];
public:
TElementField&operator[](int index) {
return Fields[index];
}
};
int _tmain(int argc, _TCHAR* argv[])
{
TOperator Operator;
if(Operator[0].state == 1) {
//....
}
TOperator* Operator = new TOperator;
// ???
if(Operator[0]->state == 1) {
//....
}
return _getch();
}