首页 > 解决方案 > 未知类型名称?

问题描述

为什么它告诉我“首席”是未知类型名称?

#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);
    }
}

我试图在结构之后 int 首席,但代码崩溃了,“首席”仍然未知

标签: cstruct

解决方案


推荐阅读