"exercice.exe a rencontré un problème et doit fermer. Nous vous prions de nous excuser pour le désagrément encouru.
Veuillez signaler ce problème à Microsoft
nous avons créer un rapport d'erreur que vous pouvez nous envoyer. Nous traiterons ce rapport confidentiellement et anonymement
Pour afficher les données de ce rapport d'aerrues, Cliquez ici"
Mon programme comporte au moins une centaine de lignes, voici un bout concernant la lecture des données :
#include <fstream.h>
#include <iostream.h>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
void main(int argc, char *argv[])
{
int nbIndivLig, nbIndivCol, nbClasseLig, nbClicMax,nbClicMin, nbClasseCol, i, k, j;
float generer(float **DD, FILE *alphaFile, FILE *opFile, FILE *tabFile,float **DDD, int nbIndiv, int nbClicMin, int nbClicMax, int nbClasseLig, int nbClasseCol);
void transposee(int lig,int col,float **Tab,float **transposeeTab,FILE *TabFile);
float tt;
FILE *ipFile;
FILE *alphaLigne;
FILE *alphaColonne;
FILE *opFile;
FILE *tabFile;
float *tab;
float **DD;
float **DDD;
float **DDDD;
float **DDDtranspo;
if ((argc!=10))
{
printf("format: artificialData ipFile alphaLigne alphaColonne opFile tabFile nbIndivLig nbIndivCol nbClicMin nbClicMax\n");
exit(1);
}
argv++;
cout<<"Input File = "<<*argv << endl;
if ((ipFile=fopen(*argv,"r"))==NULL)
{
printf("Error: can't open input file %s\n",*argv);
exit(1);
}
argv++;
cout<<"alphaLigne File = "<<*argv << endl;
if ((alphaLigne=fopen(*argv,"r"))==NULL)
{
printf("Error: can't open alphaLigne file %s\n",*argv);
exit(1);
}
argv++;
cout<<"alphaColonne File = "<<*argv << endl;
if ((alphaColonne=fopen(*argv,"r"))==NULL)
{
printf("Error: can't open alpha file %s\n",*argv);
exit(1);
}
argv++;
cout<<"Output File = "<<*argv << endl;
// fichier des résultats
if ((opFile=fopen(*argv,"w"))==NULL)
{
printf("Error: can't open output file %s\n",*argv);
exit(1);
}
argv++;
cout<<"Fichier de sortie = "<<*argv << endl;
// deuxième fichier des résultats
if ((tabFile=fopen(*argv,"w+"))==NULL)
{
printf("Error: can't open tabFile file %s\n",*argv);
exit(1);
}
argv++;
nbIndivLig=atoi(*argv);
cout<<"nombre d'individus sur les lignes = "<<nbIndivLig << endl;
argv++;
nbIndivCol=atoi(*argv);
cout<<"nombre d'individus sur les colonnes = "<<nbIndivCol << endl;
argv++;
nbClicMin=atoi(*argv);
cout<<"Nombre minimal de clics = "<<*argv << endl;
argv++;
nbClicMax=atoi(*argv);
cout<<"Nombre maximal de clics = "<<*argv << endl;
// read number of data points
if(fscanf(ipFile,"#nbClasseLig=%d nbClasseCol=%d\n",&nbClasseLig,&nbClasseCol)!=2)
{
printf("Format error in first line\n");
exit(1);
}
printf("nbClasseLig=%d nbClasseCol=%d\n",nbClasseLig,nbClasseCol);
tab=(float *)calloc(nbClasseCol,sizeof(float ));
DD=(float **)calloc(nbClasseLig,sizeof(float *));
for (k=1; k<=nbClasseLig; k++)
DD[k]=(float*)calloc(nbClasseCol,sizeof(float));
for(i=1;i<=nbClasseLig;i++)
for (j=1; j<=nbClasseCol; j++)
fscanf(ipFile,"%f ",&(DD[i][j]));