![]() |
| ||
| problem in constructing two dimensional array in c++ using classes class matrix { int **p; int d1,d2; public: matrix(int x,int y); //constructor allocates block of specified size /*I am not specifying contructor code*/ void get_element(int i,int j,int value) { p[i][j]=value; } int put_element(int i,int j) { return p[i][j]; } // return statement encountering access violation during runtime , Help!!! }; |
| ||
| Re: problem in constructing two dimensional array in c++ using classes Please use code tags. class matrix You're going to have to post more code unless someone else sees something wrong with what you posted. I don't. I'm guessing the problem is in your constructor. |
| ||
| Re: problem in constructing two dimensional array in c++ using classes your constructor is probably wrong |
| ||
| Re: problem in constructing two dimensional array in c++ using classes int put_element(int i, int j) |
| All times are GMT -4. The time now is 3:20 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC