
Untitled
By: a guest on
May 10th, 2012 | syntax:
None | size: 1.16 KB | hits: 16 | expires: Never
#include "header.h"
int main()
{
int a,i,j,scegli,righe,colonne;
float elem;
indice=0;
FILE *fp;
fp=fopen("matrice.txt","r");
if(fp==NULL)
{
printf("errore nell'apertura del file\n");
system("pause");
exit(1);
}
else
leggiMatricedafile(fp,&VettMatrici[0]);
fclose(fp);
fp=fopen("MatriceB","ab+");
if(fp==NULL)
{
printf("errore nell'apertura del file\n");
system("pause");
exit(1);
}
else
fwrite(&VettMatrici[0],sizeof(float),1,fp);
fread(&VettMatrici[1],(leggiRighe(&VettMatrici[0])*leggiColonne(&VettMatrici[0]))*sizeof(float),1,fp);
fclose(fp);
FILE *pf;
pf=fopen("matrice1.txt","w");
if(pf==NULL)
{
printf("errore nell'apertura del file\n");
system("pause");
exit(1);
}
else
scriviMatricesufile(pf,&VettMatrici[0]);
fclose(pf);
CreaMatrice (&VettMatrici[2],leggiColonne(&VettMatrici[1]),leggiRighe(&VettMatrici[1]));
MatTrasposta(&VettMatrici[1],&VettMatrici[2]);
stampaMatrice(&VettMatrici[1]);
system("pause");
return 0;
}