Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the postfix "_t" stand for in C? [duplicate]

Tags:

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.

like image 944
willc2 Avatar asked Sep 08 '09 00:09

willc2


People also ask

What does _t mean in C?

The _t implies a typedef, a defined data type. The typedef is based on an existing type. Here are the basic C language data types: char. int.

What is _t in uint32_t?

_t usually means type, and sometimes typedef.

Why is Size_t called Size_t?

The name size_t essentially means "size type", and you will typically see this data type used to specify the size or length of things - like the length of a C string returned by the strlen() function, for example. This is not one of the "built-in" data types of C/C++.


2 Answers

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.

like image 120
Sufian Avatar answered Oct 06 '22 05:10

Sufian


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

like image 29
nairdaen Avatar answered Oct 06 '22 05:10

nairdaen