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?

  • 2
    Just guessing, but what about "type"? – Joachim Sauer Jan 21 '13 at 12:07
  • @JoachimSauer Good guess; that would make sense. – Qix - MONICA WAS MISTREATED Jan 21 '13 at 12:10
  • Duplicate. – user29079 Jan 22 '13 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. – Qix - MONICA WAS MISTREATED Jan 22 '13 at 15:30

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

| improve this answer | |
  • so it's a form of hungarian notation? – MattDavey Jan 21 '13 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++. – tdammers Jan 21 '13 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.