2009-07-26から1日間の記事一覧
ようするに、1文字ずつ cast したらいいのかもしれないんだけど。 で、あれですね、static_cast(char) の場合、1文字が、asciiコードになるので、「 - '0'」とかしてやると数値になるわけですね。で、文字列をintにしてやろう、とか考えると、 #include <iostream> #in</iostream>…
#include <iostream> #include <sstream> #include <string> using namespace std; int main() { string hoge = "hoge", fuga = "fuga"; // some method of std::string cout << hoge << endl; cout << hoge.length() << endl; cout << hoge.at(1) << endl; cout << hoge.substr(1,2) <<</string></sstream></iostream>…
はつとっぷこーだ。まあpracticeだけど。