livlea blog

Live as if you were to die tomorrow. Learn as if you were to live forever. (Mohandas Karamchand Gandhi)

2018-08-30から1日間の記事一覧

C++でのクラス初期化方法まとめ

c++でクラスをインスタンス化する際、以下のようにnewを使わない方法、newを使う方法、vectorコンテナを使う方法がある。 Hogeクラス class Hoge { private: int num; public: Hoge(); Hoge(int n); void Disp(); ~Hoge(); }; // デフォルトコンストラクタ H…