C++における文字列とコンテナの実用的な操作技法

文字列処理の基本操作 初期化方法: std::string text1; // 空文字列 std::string text2 = "greetings"; // リテラル初期化 std::string text3(text2); // コピー初期化 std::string text4("planet"); // C文字列からの初期化 std::string text5(6, 'x'); // 6個の'x'で構成 長さ取得・アクセス: size_t length ...

6月13日 18:39 投稿