C语言中 多个源文件之间函数如何调用问题
C语言中 多个源文件之间函数如何调用问题主调函数文件321.c
程序代码:#include<stdio.h>
#include<malloc.h>
struct add *wwe();
struct add
{
int xuehao;
};
main()
{
struct add *p1;
wwe();
}
被调函数文件332.c
程序代码:#include <stdio.h>
#include<malloc.h>
struct add *wwe()
{
extern struct add *p1;
p1=(extern struct add *)malloc(sizeof(extern struct add));
}
为什么会出现这样的错误呢?
332.c
C:\Program Files\Microsoft Visual Studio\MyProjects\123\332.c(6) : error C2027: use of undefined type 'add'
C:\Program Files\Microsoft Visual Studio\MyProjects\123\332.c(3) : see declaration of 'add'
执行 cl.exe 时出错.
麻烦大家帮我改一下呢









