bonjour, j'ai créer un programme en c qui doit passé une structure et le compilateur ne conné pas les champs de ma structure... sachant que ma structure doit être déclaré dans main().

voici mon prg:


#include <stdio.h>
#include <conio.h>
#include <string.h>
void ajout_data();
void main()
{
struct gamme_audi
{
short CE; //flag d'effacement (1(non effacé) ou 0(effacé))
char nref[21]; //référence de la designation
char marque[30]; //soit audi,merco,bmw
char model[30]; //indiquera la marque (merco, bm,audi)
float phtva; //prix tva non comprise
float tva; //le taux applicable au prix
float ptvac; //prix tva comprise
}data;
ajout_data(data);
getch();
}
void ajout_data(struct gamme_audi *data)
{
int i;
int sw;
FILE *f;
f=fopen("gamme_audi.dat","rb"); //ouverture en ajout
if(f==NULL)
{
printf("erreur");
}
else
{
sw=0;
while(sw==0)
{
//je ne presente pas le caractère d'effacement c pas prévu pour ici
fflush(stdin);
printf("\n n° de reference : ");
scanf("%s",data->nref);
fflush(stdin);
printf("\n marque du model : ");
scanf("%s",data->marque);
fflush(stdin);
printf("\n model : ");
scanf("%s",data->model);
fflush(stdin);
printf("\n prix hors tva : ");
scanf("%f",data->phtva);
fflush(stdin);
printf("\n taux de tva : ");
scanf("%f",data->tva);
fflush(stdin);
//calcul du prix tvac
data->ptvac=data->phtva*data->tva;
printf("\nle prix tvac est calculer automatiquement : %.2f",data->ptvac);
fwrite(&data,sizeof(data),1,f); //ecriture dans le fichier
do
{
printf("\n\nvoulez vous ajouté un autre enregistrement ? (o/n) : ");
scanf("%c",&rep);
if(rep=='o' || rep=='O')
{
sw=0;
}
else
{
if(rep=='n'||rep=='N')
{
sw=1;
}
}
}
while(rep!='O' && rep!='o' && rep!='n' && rep!='N');
}
}
}

alors d'après vous que dois je faire ou que n'est fait pour que ca marche ???