Matrix dimensions
-
hello! in my mfc-program i need a two dimensional matrix. my problem is: the dimensions (Rows, Cols) are no constant integers, they are integers, only. a few people in this forum tried to help me, but i still have errors and problems. i know, now (because of the feedback here), that i must do something with 'new' and 'pointer'. who can help me more in detail? MFC
-
hello! in my mfc-program i need a two dimensional matrix. my problem is: the dimensions (Rows, Cols) are no constant integers, they are integers, only. a few people in this forum tried to help me, but i still have errors and problems. i know, now (because of the feedback here), that i must do something with 'new' and 'pointer'. who can help me more in detail? MFC
i recomand u using vector of vectors its better that way, see STL Type: std::vector If u want to use pointers its something like this:
double ** ppDouble ;
for ( int iLines= 0 ;iLines<iNumberOfLines;iLines ++)
ppDouble = new (double*);for ( int iColumns=0;iColumns<iNumberOfColumns ;iColumns++)
ppDouble [ iColumns ] = new double;for ( int iLines= 0 ; iLines< iNumberOfLines ; iLines ++)
for ( int iColumns=0; iColumnsPapa
while (TRUE)
Papa.WillLove ( Bebe ) ; -
hello! in my mfc-program i need a two dimensional matrix. my problem is: the dimensions (Rows, Cols) are no constant integers, they are integers, only. a few people in this forum tried to help me, but i still have errors and problems. i know, now (because of the feedback here), that i must do something with 'new' and 'pointer'. who can help me more in detail? MFC
You could use this ready built class http://www.codeproject.com/cpp/MatrixClass.asp[^] Roger Allen Sonork 100.10016 I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
-
i recomand u using vector of vectors its better that way, see STL Type: std::vector If u want to use pointers its something like this:
double ** ppDouble ;
for ( int iLines= 0 ;iLines<iNumberOfLines;iLines ++)
ppDouble = new (double*);for ( int iColumns=0;iColumns<iNumberOfColumns ;iColumns++)
ppDouble [ iColumns ] = new double;for ( int iLines= 0 ; iLines< iNumberOfLines ; iLines ++)
for ( int iColumns=0; iColumnsPapa
while (TRUE)
Papa.WillLove ( Bebe ) ;great, thanks.....:rose: only one small mistake: u wrote: for(int iColumns=0 ; iColumns