我的编译器(Gcc)警告我:
警告:函数的隐式声明
请帮我弄明白为什么会来。
发布于 2018-03-23 14:59:33
正确的方法是在标头中声明函数原型。
#ifndef MAIN_H
#define MAIN_H
int some_main(const char *name);
#endif
#include "main.h"
int main()
{
some_main("Hello, World\n");
}
int some_main(const char *name)
{
printf("%s", name);
}
选择一个文件(main.c)
static int some_main(const char *name);
int some_main(const char *name)
{
// do something
}
https://stackoverflow.com/questions/-100003674
复制相似问题