c++ - intptr_t中_t的含义

标签 c++ c nginx

我想知道什么是 intptr_t ? (_t) 是什么意思?它是(树)的第一个词还是什么?

例如,在 nginx Web 服务器中,ngx_xx_t (_t) 是什么?

(ngx_xx_t ) 和 (ngx_xx_s) 有什么不同?什么是 (_t) 和 (_s) ? (缩写)

最佳答案

一般来说,后缀_t指的是typedef_s指的是结构体。对于编译器来说没有什么区别,只是为了用户阅读代码的好处。这曾经是应用此类后缀的常见做法,但由于与 POSIX 冲突和基本的人类混淆,现在不鼓励这样做。其他类似讨论

示例:

// Discouraged
struct foo_s {
    int bar;
};
typdef struct foo_s foo_t;

// Friendly
typedef struct foo_struct {
    int bar;
} foo_type;

关于c++ - intptr_t中_t的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22995831/

相关文章:

c++ - std::make_unique 导致大幅减速?

c++ - 比较两个包含字符串的 vector 的快速方法

c++ - 显示嵌套类/结构之间关系的工具

c++ - 用 C++ 发出 putenv 警告

c - LD_PRELOAD 不适用于我的程序

ruby-on-rails - 缓存Rails Assets 时的NGinX权限问题

c - 'getchar()'在这个程序中有什么用呢?

可以创建函数返回零,它的含义是什么?

django - 在Django应用上使用Gunicorn进行Nginx重定向无法正常工作

testing - 使用 Nginx 将 GET 参数插入静态文件