コード例 #1
0
ファイル: cristalli1.c プロジェクト: Drugozzo/Esercizi_C
int main(void){

	char **m;
	int t,l;
	scanf("%d",&t);
	l=latoCristallo(t);
	printf("%d\n",l );
	m=creaMatrice(l);
	stampaMatrice(m,l);
	//crist(m,l,l,l);
	stampaMatrice(m,l);
	return 0;
}
コード例 #2
0
ファイル: cristalli.c プロジェクト: Drugozzo/Esercizi_C
int main(void){

	int t,l;
	char **m;

	scanf("%d",&t);
	l=latoCristallo(t);
	
	m=creaMatrice(l);
	printf("%c\n",m[0][0]);
	printf("%d\n",l );
	crist(m,l/2,l/2,l);
	stampaMatrice(m,l);
	return 0;
}
コード例 #3
0
/*
 * 	Function : leggiMatriceDaFile()
 * 	@parameters :
 * 		- mat_file : pointer to the file( textual file ) from which will be read the matrix
 * 		- m : pointer to a matrix
 *
 *
 * */
void leggiMatriceDaFile( FILE *mat_file, matrice *m )
{
    int row, col;
    int i = 0, j = 0;
    float x;

    fscanf(mat_file,"%d %d\n", &row, &col );
    if ( !creaMatrice(m, row, col) )
    	set_error(EMFNR);
    else
    {

    	for ( i = 0; i < row; i++ )
    	{
    		for ( j = 0; j < col; j++ )
    		{
    			fscanf(mat_file,"%f ", &x);
    			scriviElemento( m, i, j, x);
    		}
    	}
    }

}