0

why does it tells me that "chief" is unknown type name ??

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
FILE*input,*output;
struct chief
{char name[20];
char position[20];
int meals_made;
double salary;
int age;
};
int gainings_and_losses(chief gain[]){
for(int k=0;k<10;k++){
if(gain[k].meals_made>10){
    if(gain[k].salary<3000.0){
        gain[k].salary=gain[k].salary*2.3;
        fprintf(output,"%s salary for will be% \n", gain[k].name,gain[k].salary);
    }
    else if(gain[k].salery>3000){
        gain[k].salary=gain[k].salary*1.4;
        fprintf(output,"%s salary for the next month will be% \n", gain[k].name,gain[k].salary);
    }
}

I tried to int chief after the struct but the code broke down and still the "chief" is unknown

0 Answers0