we haven't been learned how to use dynamic array but I've read about it on the net and tried to use that for a program in which you want to calculate the determinant of an n*n matrix , but I don't know why the thread is stoped in the middle of the process , the output I had was so wired , I just did'nt know what to do ,
and THERE ARE TWO THINGS THAT I SHOULD EXPLAIN :
first : I haven't erased the parts that I've canceled , you can skip reading them .
second : there are some non-English words or phrases but most of the program is in English
third : I was bound tow cancel some functions becuz of **array but I don't exactly know why
//int eliminate( void *ptr_matrix , int martabeOFresult , int omitRow ,
//int omitColumn )
//det( //mikhastam arayeii az tabe tarif konam vali baiide beshe
/* det3//I wanted to declare an array of functions but I don't think it's
det4, det5 */
//Desk is a func to manage the process :
void //Desk( const int , int **/**/ ,
//const int  , const int  ) ,
//Design( int const , int const , int ** , int ** , const int , int ** ) ,
//colloge function gives the pricipal matrix with all of its elements ,
//an array that contains the number of the rows and the columns and the joint //element of itself and the joint element of itself multiplied by the joint //elements of former phases ,
//and a new array that should be filled in this function ,
//and the row and the column that should be removed in this phase
Collage( /*const*/ int ** , int const  , int  , int const ,
int const , int const , int const ) ,
//prints the the determinant form of matrix using the character |
DetPrinter( const int , const int , const int , const int , /*const*/ int** , const int ) ,
//prints a matrix using [ at the left top and left bottom , ] at the right top //and the right bottom , | for middle parts
Matkesh( int ** , int , int ) ;
//counts the number of the digits of an integer number
int Digitshomar( int ) ,
Determinant( int , int , int , int ) ;
cout << "\nsuppose that a 3*3 matrix is defined as :\n"
<< "\n [ 1 2 3 ]"
<< "\n | 4 5 6 |"
<< "\n [ 7 8 9 ]"
<< "\n\nchoose a row and a column of it ( enter numbers between 0 and 2 )"
<< "\nrow = " ;
cin >> remove_row ;
cout << "column = " ;
cin >> remove_column ;
Collage( sample , jindexSample , eliminatedSample ,
remove_row , remove_column , 3 , 2 ) ;
cout << "\nafter droping row " << remove_row << " and column "
<< remove_column << " your matrix will be :\n" ;
Matkesh( sample , eliminatedSample , 2 ) ;
cout << "\nand the element[" << remove_row << "][" << remove_column << "] * "
<< "(-1)^( " << remove_row << "+" << remove_column << " ) = "
<< eliminatedSample ;
cout << "\n\nBy these tools , this program is able to calculate the "
<< "determinant of any matrix ."
<< "\nin every step , for every outcome matrix of the recent phase"
//I couldn't translate it well
//but bast the matrix nesbat
//means that you want to drop
//that column or row besides
//another row/column which is
//varied in every step
<< ", you can choose a\nrow or column to bast the matrix nesbat , "
<< "and the result of bast will be shown\nevery element will be set in a "
<< "4 width field , so your figures should have up to 4 digits , besides"
<< " multiplication of \"n\" arbitrary elements should have up to\n"
<< "13 digits to have a nice output ( \"n\" is the martabe of your "
<< "matrix )\n" ;
cout << "wich number do you like for martabe ? " ;
cin >> Emperor ;
Queen = new int*[ Emperor ] ;
for( i = 0 ; i < Emperor ; i++ )
Queen[i] = new int[ Emperor ] ;
cout << "enter your matrix :\n" ;
for( i = 0 ; i < Emperor ; i++ )
if( i == Emperor/2 )
cout << "Matrix = " ;
cout << setw(9) << ' ' ;
for( j = 0 ; j < Emperor ; j++ )
cin >> Queen[i][j] ;
}//end for j
}//end for i
////sakhtane 2 araye first tedade martica dar har marhale second tedade onasore
//////////matricaye un marhale :
first = new int[ Emperor+1 ] ;
second = new int[Emperor] ;
When you have a very long code segment it's generally encouraged to use a site like http://pastebin.com and share the link with us. If you do want to place it only here, wrap the code in code tags to make it more readable: [code] code here [/code].
What do you mean by "the thread is stopped in the middle of the process?" do you mean that the program exits during execution? If so, at which point does it exit and with which error message?
If you could take these into consideration that would greatly help us to help you.
Also, if there is a need for multiple posts on the same topic, post them all as replies to the one and only original thread. That reduces wasted time and effort for everybody. This is intended to be helpful advice, not a criticism.