n 個のセルを割り当てている double へのポインターがあります。次に、このポインターの begin および end iterator オブジェクトにアクセスする必要があります。これが私のコードです:
*my_module.cpp*
# include c_vector.h
/* .. */
C_Vector a(n);
*c_vector.h*
class C_Vector{
/* .. */
public:
C_Vector (int n);
bool Create (int n);
private:
int n_s;
double *z;
}
*c_vector.cpp*
C_Vector::C_Vector(int n) {
Create(n);
}
bool C_Vector::Create(int n) {
if ( (z = (double *)malloc(n * sizeof(double))) != NULL ){
n_s = n;
}
}
モジュールファイルで、a.begin() にアクセスしたいと考えています。どうやってやるの?出来ますか?お知らせ下さい。
アビシェク