On Jun 20, 11:25 am, Amber <guxiaobo1...@gmail.comwrote:
For example if anywhere defined MyChar as
typedef char MyChar;
Now I want to redefine MyChar as wchar_t, how can I do this?
I exactly can't predict on what context you need to behave like this.
typedef is a compile time operator.
In my assumption, you are trying to do a typdefinition according to
some other definitions. Like UNICODE..
In that context you can do as follwos
#ifdef UNICODE // or the symbol you need
typedef char MyChar;
#else
typedef wchar_t MyChar;
#endif
You only need to define or undefine symbol as per your requirement.
Regards,
Sarath
http://sarathc.wordpress.com/