git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11867 626c5289-ae23-0410-ae9c-e8d60b6d4f22
24 lines
599 B
C
24 lines
599 B
C
double sumitems(double *first, int nbRow, int nbCol);
|
|
void main(){
|
|
/**
|
|
* --> myMatrix=[ 103 3 1 12;0 0 2043 1];
|
|
* --> sumitems(myMatrix);
|
|
* 32
|
|
*/
|
|
double B[] = {1,3,4,9,2,8,3,2}; /* Declare the matrix */
|
|
int rowB = 2, colB = 4;
|
|
printf("sumitems: %6.2f\n",sumitems(B, rowB, colB));
|
|
|
|
|
|
/**
|
|
* --> myOtherMatrix=generateValues();
|
|
* --> size(myOtherMatrix);
|
|
*/
|
|
int numberRow, numberCol, i;
|
|
double * matrix=getValues(&numberRow, &numberCol);
|
|
printf("Matrix of size [%d,%d]",numberRow, numberCol);
|
|
for(i=0; i < numberRow*numberCol; i++)
|
|
{
|
|
printf("A[%d] = %5.2f\n",i,matrix[i]);
|
|
}
|
|
}
|