typedef struct tagFileList { int fNo;char *fName;int fOffset;int fSize;int fType;} myFileList;class FileList{ public:FileList(int n){ pfile = new myFileList[n];for(int i = 0; i < n; i ++){ pfile[i].fNo = i;} } ~FileList(){delete []pfile; } public:int query(...
因为任何类型都实现了 interface{}, 在你的函数需要返回不同的类型的时候就可以定义函数的返回值为 interface{}; 然后使用 reflect 包对函数的返回值进行处理 "return &TestStruct{}" 返回的是指针类型"return TestStruct{}" 返回的是你定义的类型 TestStruct都实现了 interface{}, 即可以作为函数的返回值; 他们...