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.
ヘッダー ファイルのクラス定義で文字列型の変数を定義しようとしています。出来ますか?例:
/* Foo.h */ #include <string> class Foobar{ int a; string foo; }
どういうわけか、メインでは文字列変数を宣言できますが、ヘッダーでは文字列型を認識しません。
string名前空間に住んでいますstd。それを作る:
string
std
#include <string> class Foobar { int a; std::string foo; };