#include ”functions.h”
typedef struct
{
int x, int y, int z;
}Model;
int main()
{
Model PARA[100];
PARA=malloc(sizeof(struct Model));
myfunction(int A, int B, int C,
PARA);
return:
}
In another file, I define “myfunction”:
void myfunction(int a, int b, int c,
Model *para)
{
a=b=c=10 ; /*can be any value*/
para.x=10;
para.y=20;
para.z=30;
}
In “functions.h” , I have :
void myfunction(int a, int b, int c,
Model *para);
When I compile it, some error come out:
error: syntax error before “Model’
another function call the same struct in .h, but the compiler shows
error: syntax error before ‘*’ token;
I think the problems come from same error. I check the codes carefully, but still can not figure out.