是一个在其声明和定义中没有指定存储类的函数:
void func(void); // declaration
void func(void) { // implementation
}
在其声明和定义中是否等同于具有extern 存储类的函数? :
extern void func(void); // declaration
extern void func(void) { // implementation
}
最佳答案
来自C标准(6.2.2标识符的链接)
5 If the declaration of an identifier for a function has no storage-class specifier, its linkage is determined exactly as if it were declared with the storage-class specifier extern. If the declaration of an identifier for an object has file scope and no storage-class specifier, its linkage is external.
关于c - 默认情况下函数是外部的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71194445/