typedef int scorers[LESSONS_NUM]
int *pScorer = new scorers;
delete pScorers; //Wrong!!!
delete[] pScorers; //Right
为了避免这样的错误,建议不要对数组类型typedef,或则采用STL中的vector代替数组。
typedef int scorers[LESSONS_NUM]
int *pScorer = new scorers;
delete pScorers; //Wrong!!!
delete[] pScorers; //Right
为了避免这样的错误,建议不要对数组类型typedef,或则采用STL中的vector代替数组。