how do you put struct pointers into functions?
This is my struct
Code:
typedef struct{
char first[20];
char last[20];
int nums[6];
}RECORD;
this is my function prototype
Code:
void writeRecord (RECORD* , FILE*, int);
this is my functions
Code:
void writeRecord (RECORD* people, FILE* fp, int num_people){
...................
}
in my main i put
Code:
RECORD* people;
people = (RECORD*) malloc(num_people*sizeof (RECORD));
writeRecord(people, fp, num_people);
can you guys tell me where i'm going wrong.
these are the errors i get in microsoft visual c++ 2008
these all point to the prototype
syntax error: ')'
syntax error: ','
syntax error: missing ')' before '*'
syntax error: missing '{' before '*'
these point to the function
writeRecord: redifinition; different basic types