Arr*_*kis 11 c c++ static declaration function
我希望有一个静态函数,我在定义之前在我的.c文件中声明:
//file a.c version 1
static int foo();
...
static int foo()
{
...
}
Run Code Online (Sandbox Code Playgroud)
但是,似乎我可以将static关键字从函数定义中删除,并且我没有得到编译器警告......例如
//file a.c version 2
static int foo();
...
int foo()
{
...
}
Run Code Online (Sandbox Code Playgroud)
假设这两种形式完全相同,我是否正确?
如果是这样,为什么允许这种差异,我应该使用哪种形式?
| 归档时间: |
|
| 查看次数: |
7321 次 |
| 最近记录: |