error C2172: 'fwrite' : actual parameter is not a pointer : parameter 1???
Full code
Code:
if(file != NULL){
while(head != NULL){
fwrite(head->code,sizeof(head->code),1,file);
fwrite(head->name, sizeof(head->name),1,file);
fwrite(head->dob->day, sizeof(head->dob->day),1,file);
fwrite(head->dob->month, sizeof(head->dob->month),1,file);
fwrite(head->dob->year, sizeof(head->dob->year),1,file);
fwrite(head->jobCat, sizeof(head->jobCat),1,file);
fwrite(head->basicPay,sizeof(head->basicPay),1,file);
//error C2172: 'fwrite' : actual parameter is not a pointer : parameter 1
fwrite(head->hours, sizeof(head->hours),1,file);
fwrite(head->dataElement->otHours, sizeof(head->dataElement->otHours),1,file);
fwrite(head->dataElement->otHours, sizeof(head->dataElement->otPay),1,file);
fwrite(head->dataElement->otHours, sizeof(head->dataElement->weeklyPay),1,file);
head = head->nextElement;
}
Hi, i am writing these data to a binary file, but i am getting a compliation error here
Code:
fwrite(head->basicPay,sizeof(head->basicPay),1,file);
/error C2172: 'fwrite' : actual parameter is not a pointer : parameter 1
and i dun see the reason why because the rest work fine but just that element..
Can anyone guide me to solving this problem