【发布时间】:2014-06-19 03:56:37
【问题描述】:
我目前正在编写 C 程序,我在函数中使用结构和指针。一切都在 Windows 中运行良好,但不是 linux debian。当我尝试在 Linux Debian 中编译我的程序时遇到了一些错误。
typedef struct human
{
char name[100],code[100];
}human;
void hello(char* name, char* code)
{}
int main()
{
human human;
hello(&human.name,&human.code);
return 0;
}
我在编译 main.c 文件时收到这些警告:
Warning passing argument 1 of Human from incompatible pointer type Note: expected char *a but argument is type of char(*)[100] Warning passing argument 2 of Human from incompatible pointer type Note: expected char *a but argument is type of char(*)[100]
【问题讨论】: