-3

谁能解释为什么在 C++ 中将函数设为静态使其仅在内部链接。这只是来自平面标准还是一些语言技巧?

4

1 回答 1

0

static can be confusing, because it has a few different meanings depending on context. In this context, it means that the variable being defined is visible only in the current translation unit:

int i;        // visible in all translation units
static int j; // visible only in the current translation unit
于 2018-11-29T14:29:39.927 回答