What does the postfix “_t” stand for in C? [duplic

2019-01-18 10:42发布

Possible Duplicate:
What does a type followed by _t (underscore-t) represent?

While typing in my IDE (Xcode), autocomplete pops up already-defined words when I'm partway thru entering some variable name. I occasionally see names that have '_t' at the end of them.

  1. What naming convention is that and what does it mean?

  2. Is there a reference document to look up pre- and post-fixes in common use?

Searching with the term "postfix" gives me a lot of GoogleNoise about the mail server of the same name.

3条回答
▲ chillily
2楼-- · 2019-01-18 10:50

The t stands for "type" or "typedef." You'll see a lot of POSIX headers (and others) with time_t, size_t, and others. These which hold (not necessarily defined) specific bit-sizes based on the operating system and machine architecture.

查看更多
狗以群分
3楼-- · 2019-01-18 10:50

based only on my own experience, the "_t" postfix means "data type". In other words, it's a datatype defined used typedef.

查看更多
Bombasti
4楼-- · 2019-01-18 11:12

The "_t" suffix is a convention for data type names such as size_t or wchar_t. It's not used consistently.

查看更多
登录 后发表回答