here is the code I came across recently
_tmain??? _TCHAR * ??? what do those strange things mean??Code:int _tmain(int argc, _TCHAR* argv[])
here is the code I came across recently
_tmain??? _TCHAR * ??? what do those strange things mean??Code:int _tmain(int argc, _TCHAR* argv[])
MSDN sez: You can also use _tmain, which is defined in TCHAR.h. _tmain will resolve to main unless _UNICODE is defined, in which case _tmain will resolve to wmain.
And somewhere in the depths of the windows headers, I would presume that _TCHAR is typedef'd as just a primitive char, unless _UNICODE is defined in which case it would resolve to a unicode wide character. This is all just VC++ Microsoft specific stuff I guess, just for ASCII and unicode wide char support extensions.
Last edited by Tonto; 08-15-2005 at 06:38 PM. Reason: Dunno.
So it means that _tmain and _TCHAR are not Standard C, and they are not portable, right?Originally Posted by Tonto
_tmain and _TCHAR are not standard C
> So it means that _tmain and _TCHAR are not Standard C, and they are not portable, right?
Exactly, but as another poster mentioned, it allows you to switch on and off UNICODE support much more easily.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.