gpt4 book ai didi

c - __func 函数的约定是什么?

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:30:47 26 4
gpt4 key购买 nike

我在 Linux 代码中看到了一堆名为 __foo 的函数。双下划线代表什么,应该在什么时候使用?

最佳答案

这意味着它是一个保留标识符。 C++ 03和C99标准都提到了这一点。

C99:

7.1.3 Reserved identifiers

  • All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.
  • All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces.

C++ 03:

Each name that contains a double underscore (_ _) or begins with an underscore followed by an uppercase letter (2.11) is reserved to the implementation for any use.

您还可以引用:

关于c - __func 函数的约定是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10477458/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com