[問題] 回傳自定義型別指標(Be solved!)
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Linux
NetBeans 7.0.1
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
None
問題(Question):
請問函數可以回傳自己定義的型別指標嗎?
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
以下是 main.cpp 的部份程式碼
#include "table_scan.h"
struct tableList {
int index;
char keyword[100];
tableList *next;
};
typedef tableList* tablePt;
int main(int argc, char** argv) {
tablePt table1 = ScanTable(1); //這行跳出'ScanTable' was not declared
in this scope
}
main.cpp 到此結束
table_scan.h 由此開始
tablePt ScanTable(int list) { //這行跳出‘tablePt’ does not name a type
tablePt temp = NULL;
blablabla statement;
return temp;
}
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.135.255.154
→
10/05 16:28, , 1F
10/05 16:28, 1F
→
10/05 16:46, , 2F
10/05 16:46, 2F
→
10/05 16:47, , 3F
10/05 16:47, 3F
→
10/05 16:47, , 4F
10/05 16:47, 4F
→
10/05 16:48, , 5F
10/05 16:48, 5F
→
10/05 16:53, , 6F
10/05 16:53, 6F
→
10/05 18:16, , 7F
10/05 18:16, 7F
→
10/06 10:51, , 8F
10/06 10:51, 8F
→
10/06 11:04, , 9F
10/06 11:04, 9F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章