Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はクラスを持っています:
class cAsset{ public: void data(int); int returnInfo(void); }
および cAssets の配列を返すと想定される関数
cAsset[] myFunc(int a, int b){ ... }
エラーは次のとおりです。
Expected member name or ';' after declaration specifiers
私は何が欠けていますか?
C++ で配列を返すことはできません。std::vector<cAsset>代わりに a を返してみてください。
std::vector<cAsset>
std::vector<cAsset> myFunc(int a, int b){ std::vector<cAsset> result; result.push_back(cAsset(4,2)); result.push_back(cAsset(a,b)); return result; }