2008-09-04から1日間の記事一覧

今日の実験

c++

test.h #ifndef _TEST_ #define _TEST_ class CA{ private: int m_integer; public: CA(int a); void print_a(); }; class CB{ private: CA *m_pa; public: CB(); CB(CA *a); void print_b(); }; #endif test.cpp #include "test.h" #include <stdio.h> CA::CA(int a)</stdio.h>…

考えてたこと

c++

ヘッダファイル内で実体を生成するのはよくない。・・・(1) (1)より、 クラスを変数に格納する方法が、実体の格納と実体へのポインタの格納しかないのであれば ヘッダファイル内でクラスを格納する変数を作ろうと思ったらクラスへのポインタ型で宣言せざるを…