运算符在抽象类中重载

时间:2015-12-15 02:18:19

标签: c++ operator-overloading abstract-class

我不知道如何正确描述我的问题,所以我会告诉你:

Main.cpp的

<remove name... />

#include"stdafx.h" using namespace std; int main() { char count = 'y'; char del = 'y'; char doi = 'l'; length trl; angle krl; Sum *d2, *d3, *a; coordinates * ob = &trl; coordinates * bb = &krl; while (cont = 'y') { cout << "what program should do:" << endl; cout << "write c if you want find angle between two vectors " << endl; cout << "write l if you want find length between two points" << endl; cout << "write s if you want find two vectors sum" << endl; cin >> veiks; if (doi == 'l') { ob->action(); ob->Output(); } else if (doi == 'c') { bb->action(); bb->Output(); } else if (doi == 's') { a->action(); d3 = d2 + a; d3->Output(); } else cout << "No action isn't selected" << endl; cout << "If you want repeat program write: y, if you want end work press any key "; cin >> count; if (count != 'y') break; cout << "Do you want to clean-up screen? "; cin >> del; if (del == 'y') system("CLS"); } return 0; } 部分d3 = d2 + a显示错误:

a

任何想法如何解决?

.h 档案

expression must have integral or unscoped enum type

0 个答案:

没有答案
相关问题