「C++クラスと継承完全制覇」という参考書をもとに、
stringクラスの練習をしようとVC++で以下のソースを打ち込んだら
--
include ファイルを開けません。'cstring.h': No such file or directory
--
と言われてしまいました。
BCCdeveloperでは出来るのでとりあえず差し迫った問題ではないのですが。
VC++の有料版を買わないと標準クラスライブラリを使えないのでしょうか。
そうでないのなら使う方法や参考になるサイトなど教えてください。
//VC++版 #include <cstring.h> #include <iostream.h> main() { //文字列を作成する. Cstring s1("Apple"); Cstring s2("Orange"); Cstring s3; //文字列を代入する. s3 = s2; //文字列を比較する. if(s3 > s1){ cout << s3 << "は" << s1 << "より大きい\n"; } return 0; }
//BCC版 #include <cstring.h> #include <iostream.h> main() { //文字列を作成する. string s1("Apple"); string s2("Orange"); string s3; //文字列を代入する. s3 = s2; //文字列を比較する. if(s3 > s1){ cout << s3 << "は" << s1 << "より大きい\n"; } return 0; }