I wrote a derived class, see the code first plz :)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
class baseclass
{
...
int **body;//which will be dynamic allocated in the method definition
public:
...
int ** getbody(){return body; }
}
class derivedclass: public baseclass
{
public:
update();
}
derivedclass::update()
{
getbody()[0][1] = 10;//the problem occur here!
...
}
@ OP: What's the error you are getting? Are you maybe segfaulting because you didn't initialize your pointer to a pointer? Where is the rest of your code?