|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.learn - getting a classes array
the following chrashes what do i do wrong? how does one manipulate class A's
mVector array?
thanks
class A {
private:
int mVector[20] = 0;
public:
int* Self() {
return mVector.ptr;
}
bool StatusErrors() {
if((this.mVector[0] == 1) && (this.mVector[1] > 0))
return true;
return false;
}
void Reset() {
for(int i = 0; i < 20; i++)
mVector[i] = 0;
}
}
class B {
private:
A aa = new A;
public:
bool test() {
....
do some stuff
int i = somefunction(aa.Self());
if(aa.StatusErrors())
return false;
aa.Reset(); <------ crashes here
int i = somefunction1(aa.Self());
if(aa.StatusErrors())
return false;
}
}
May 02 2008
"lurker" <lurker lurker.com> wrote in message news:fvgv7p$1gu7$1 digitalmars.com... May 03 2008
|