我的任務是從二叉樹派生的二叉搜索樹,在我的驅動程序中,這是我創建BST對象的方式。但我有點困惑,因爲我知道必須有一個構造函數,但是在我的任務中沒有實際調用派生類的構造函數。C++派生類
int main() {
int x = 0;
int n = 0;
int len = 0;
int total = 0;
int seed = 0;
bool y;
cin >> n;
vector<int> v;
binSTree<int> t;
我在使用這些「前」和「代碼」標籤很難,矢量實際上是vector<int> v;
,樹是真的binSTree<int> t;
還有不到和更大的周圍當然INT跡象。
我在程序的錯誤如下:
In file included from prog6.cc:2:
binSTree.h:1:9: error: macro names must be identifiers
prog6.cc: In function ‘int main()’:
prog6.cc:16: error: ‘binSTree’ was not declared in this scope
SO不使用代碼的HTML代碼標籤,但縮進四個空格的東西將顯示爲包含所有尖括號的代碼。 – 2010-10-22 01:07:18
你能告訴我們頭文件'binSTree.h'嗎? ''在'prog6.cc'中#include「binSTree.h」嗎? – birryree 2010-10-22 01:08:12
此外,你還沒有顯示錯誤的代碼。 binSTree.h的第一行是什麼? – 2010-10-22 01:08:36