parent
26889a4ee5
commit
62203ccd46
@ -0,0 +1,27 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include "responsable.h"
|
||||||
|
|
||||||
|
int chargementArticles(int tRef[], float tPoids[], float tVol[], float tPrix[], float tPhysique)
|
||||||
|
{
|
||||||
|
int i=0, ref;
|
||||||
|
float volume, poids, prix;
|
||||||
|
FILE * fe;
|
||||||
|
fe = fopen("donnee/articles.txt", "r");
|
||||||
|
if ( fe == NULL)
|
||||||
|
{
|
||||||
|
perror("fopen");
|
||||||
|
}
|
||||||
|
while ( fscanf(fe,"%d %f %f %f", &ref, &poids, &volume, &prix) == 4)
|
||||||
|
{
|
||||||
|
if ( i == tPhysique )
|
||||||
|
{
|
||||||
|
fprintf(stderr,"Tableau plein");
|
||||||
|
}
|
||||||
|
tRef[i] = ref;
|
||||||
|
tPoids[i] = poids;
|
||||||
|
tVol[i] = volume;
|
||||||
|
tPrix[i] = prix;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
int chargementArticles(int tRef[], float tPoids[], float tVol[], float tPrix[], float tPhysique);
|
@ -0,0 +1,12 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include "responsable.h"
|
||||||
|
#include "../interface/interface_resp.h"
|
||||||
|
|
||||||
|
int main (void)
|
||||||
|
{
|
||||||
|
int tPhysique = 10, tRef[10], tLogique = 0;
|
||||||
|
float tPoids[10], tVol[10], tPrix[10];
|
||||||
|
tLogique = chargementArticles( tRef, tPoids, tVol, tPrix, tPhysique);
|
||||||
|
affichArticles( tRef, tPoids, tVol, tPrix, tLogique);
|
||||||
|
return 0;
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
void affichArticles( int tRef[], float tPoids[], float tVol[], float tPrix[], int tPhysique);
|
void affichArticles( int tRef[], float tPoids[], float tVol[], float tPrix[], int tLogique);
|
||||||
void affichUnArticle(int tRef[], float tPoids[], float tVol[], float tPrix[], int tLogique, int val);
|
void affichUnArticle(int tRef[], float tPoids[], float tVol[], float tPrix[], int tLogique, int val);
|
||||||
void affichUnClient(int tNumClient[], float tCagnotte[], int tSus[], int tLogique, int val);
|
void affichUnClient(int tNumClient[], float tCagnotte[], int tSus[], int tLogique, int val);
|
||||||
void affichUnClients(int tNumClient[], float tCagnotte[], int tSus[], int tLogique, int val);
|
void affichUnClients(int tNumClient[], float tCagnotte[], int tSus[], int tLogique, int val);
|
Loading…
Reference in new issue