【问题标题】:What does `i pos;` mean in C++?`i pos;` 在 C++ 中是什么意思?
【发布时间】:2014-04-05 07:29:30
【问题描述】:

我看到了一个代码here

大约在137

inline bool INISection::ReadString(const char * name, const char * & out) const
{
    //...

    i tag_index;

    if(*name == '\0')
    {
        //...
        tag_index = Iter;
    }
    else
    {
        tag_index = BinarySearch(Tags, Length, name);
    }

    //...

    return false;
}

i tag_index; 是什么意思? C++有这个语法吗?

【问题讨论】:

  • 一些愚蠢的程序员做了一些愚蠢的 typedef 来混淆代码
  • i 可能是typedeftypedef int i,可以位于#include "typedefs.h" [来自你分享的链接]
  • 为了您的理智,请停止阅读该代码。它是由一个糟糕的程序员制作的。

标签: c++ grammar


【解决方案1】:

实际上是int_fast32_t。查看 include/typdefs.h 并在第 21 行找到:

typedef int_fast32_t               i;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-06-25
    • 2015-09-18
    • 2016-02-20
    • 2016-01-22
    • 1970-01-01
    • 2021-07-12
    • 2020-06-28
    相关资源
    最近更新 更多