2012-05-16から1日間の記事一覧

C++の文字列操作

C++

以下、すべて #include <sstream> #include <iostream> using namespace std; と書いてあるものとする。 数字から文字列へ変換 int i = 10; ostringstream sout; sout << i; string s = sout.str(); cout << s << endl; 文字列から数字へ変換 string str = "123.456"; istringst</iostream></sstream>…