views:

79

answers:

2

Visual C++ CRT has several _t prefixed functions for both unicode and Ansi compatibility in the same source. So strcmp becomes _tcscmp, which I could never remember easily. So what is the hungarian notation meaning of _tcs and why Microsoft choose the way it is now instead of just simple prefixing, like strcmp -> _tstrcmp ?

A: 

I always thought tcs means "textual conversions".

The _tcs prefix is used for functions that work with _TChar which is a way of writing code that uses either single byte, Unicode or MCBS depending on some compiler flag.

This page gives more information on the generic text mappings.

Jeff Foster
+1  A: 

'tcs' just means tchar string, in counterpart to the ansi form for wide characters which is wcscmp. It is down to the desire to maintain 6 character identifier for the standard library to maintain compatibility with very old linkers which only took 6 significant characters when linking. Of course from a rational point of view it doesn't make much sense anymore.

tyranid