I checked all the answers about how to declare a structure that is used in many other files but none of them works so please can you help me to fix this problem ?
#ifndef articleStruct_h
#define articleStruct_h
#include <stdio.h>
#include <stdlib.h>
/**
/this is a struct Articl
/param prix is a float
/ param chaine is atable of chars
*/
typedef struct Article{
float prix;
char nom[50];
}Article;
#endif /* articleStruct_h */
this is : addArticle.c
#define addArticles_h
#define articleStruct_h
#include <stdio.h>
#include <stdlib.h>
#include "addArticles.h"
#include "articleStruct.h"
void add(Article * a, int n){
int i=0;
for (i=0;i<n;i++){
printf(" quel est le nom de l\'article %d : ", i+1);
fflush(stdout);
scanf("%s",(a+i)->nom);
printf(" quel est le prix de l\'article %d: ", i+1);
fflush(stdout);
scanf("%3f",(a+i)->prix);
fflush(stdin);
}
}
in the file.c it tells me that the "Article" is unknown and there an incomplete declaration when it comes to (a+i)->nom .