Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
2  
Just guessing, but what about "type"? –  Joachim Sauer Jan 21 '13 at 12:07
    
@JoachimSauer Good guess; that would make sense. –  Qix 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 Jan 22 '13 at 15:30
add comment

1 Answer

up vote 8 down vote accepted

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

share|improve this answer
    
so it's a form of hungarian notation? –  MattDavey Jan 21 '13 at 12:17
6  
@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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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