c语言结构体数组小程序,vim编译出错请教!
我用vc6.0编译链接都没事,但是放在vim里面总是提示:下面红色部分出现这样的错误:warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘int’#include<stdio.h>
#define MAX 3
struct employee
{
char name;
int age;
char sex;
long tel;
};
int main()
{
struct employee emp[MAX];
int i;
for(i=0;i<MAX;i++)
{
printf("Input name:");scanf("%s",emp[i].name);
printf("Input age:");scanf("%d",&emp[i].age);
printf("Input sex:");scanf("%c",&emp[i].sex);
printf("Input tel:");scanf("%ld",&emp[i].tel);
}
printf("name age sex tel\n");
for(i=0;i<MAX;i++)
printf("%-8s%-6d%-6c%-8ld\n",emp[i].name,emp[i].age,emp[i].sex,emp[i].tel);
return 0;
}