在doc类中定义的public类的变量为什么不能在view类中给它赋值?
在Exam6_1Doc.h中定义:
int TScore;
int score[5];
而在Exam6_1View.h中也加入了#include "Exam6_1Doc.h"
score[0]=0;
score[1]=0;
score[2]=0;
score[3]=0;
score[4]=0;
TScore=0;
错误提示:
error C2065: 'score' : undeclared identifier
error C2109: subscript requires array or pointer type
error C2106: '=' : left operand must be l-value
error C2109: subscript requires array or pointer type
error C2106: '=' : left operand must be l-value
error C2109: subscript requires array or pointer type
error C2106: '=' : left operand must be l-value
error C2109: subscript requires array or pointer type
error C2106: '=' : left operand must be l-value
error C2109: subscript requires array or pointer type
error C2106: '=' : left operand must be l-value
error C2065: 'TScore' : undeclared identifier