C++と色々

主にC++やプログラムに関する記事を投稿します。

2013-08-01から1ヶ月間の記事一覧

C++で文字列を数値に変換する方法

C++

元ネタに載っている変換方法を使ったサンプルを書いてみた。*1 atoi #include <cstdlib> #include <iostream> #include <string> #include <typeinfo> int main() { const std::string str("123"); auto num = std::atoi(str.c_str()); std::cout << typeid(num).name() << " : " << num << std::e</typeinfo></string></iostream></cstdlib>…

BOOST_PP_ITERATE

以前の記事でBOOST_PP_REPEATについて書きました。 BOOST_PP_REPEATは似たような記述を繰り返す際に利用できます。例えば、以下の様です(このコード自体に意味はありませんが…) #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/repeat.hpp> #define VALUE(z, n, d) const int BOOST_PP_CAT(VALUE_, </boost/preprocessor/repeat.hpp></boost/preprocessor/cat.hpp>…

やりたいことまとめてみる

色々やりたいことがあって手がつかないという状態なので整理する。 やらなければならないこと 就活 卒研のプログラム やりたいこと オレオレライブラリ書き C++ライブラリ WinAPIラップライブラリ DirectXラップライブラリ DXライブラリで3Dゲーム制作 Direc…