3

In many native types, a common suffix (and sometimes prefix) of t or _t is used to denote platform-independent types (such as wchar_t, int32_t, etc.)

What was the logic behind the letter t as opposed to other letters (or none at all, especially in the case of wchar_t)? Does it stand for something?

4
  • 2
    Just guessing, but what about "type"? Commented Jan 21, 2013 at 12:07
  • @JoachimSauer Good guess; that would make sense. Commented Jan 21, 2013 at 12:10
  • Duplicate. Commented Jan 22, 2013 at 14:51
  • @Lundin Not really; that question is asking what types with _t are for. I already know what they are for; I was asking where the t itself came from. Commented Jan 22, 2013 at 15:30

1 Answer 1

8

As opposed to _s which commonly denotes C structs I always envisioned _t to stand for typedefs.

2
  • so it's a form of hungarian notation? Commented Jan 21, 2013 at 12:17
  • 7
    @MattDavey: yes. A very rudimentary form, but yes. And it's mostly used because typenames and identifiers live in the same namespace in C and C++. Commented Jan 21, 2013 at 12:59

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.