When I compile I type:

g++ -o supersonic_ob supersonic_ob.C matrix_functions.C -lm

supersonic_ob.C

Code:

//Declare header files
#include "matrix_square.H" //Class definition
#include "matrix_functions.H" //Function prototype
int main(){
flow_field ob, ob1;
matrix_square b;
b = eigenvalue_minus(ob, ob1);
}

matrix_function.C

Code:

matrix_square eigenvalue_minus(flow_field &ob, flow_field &ob1)
{
int i;
matrix_square temp;
for (i = 0; i < Grids; i++)
temp.ptr[i] = 0; //Element 11
for (i = 4*Grids; i < 5*Grids; i++)
temp.ptr[i] = 0; //Element 22
for (i = 8*Grids; i < 9*Grids; i++)
temp.ptr[i] = ob.ptr[i - 8*Grids] - ob1.ptr[i - 8*Grids]; //Element 33
return temp;
}

matrix_function.H

Code:

matrix_square eigenvalue_minus(flow_field &, flow_field &);

Hope I am clear enough.