2

i want to know what is intptr_t ? what means of (_t) ? is it the first word of (tree) or what?

for example in nginx web server , what is ngx_xx_t (_t) ?

what is diffrent between (ngx_xx_t ) and (ngx_xx_s) ? what is (_t) and (_s) ? (Abbreviation)

1 Answers1

4

Generally, the suffix of _t refers to typedef, and _s to a structure. There is no difference to the compiler, but for the benefit of users reading the code. This was once a common practice to apply such suffixes, but is now discouraged due to conflicts with POSIX & basic human confusion. Other similar discussions

Example:

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

// Friendly
typedef struct foo_struct {
    int bar;
} foo_type;
Community
  • 1
  • 1
emcconville
  • 23,800
  • 4
  • 50
  • 66