How to deprecate a function?

Well what is deprecation? It’s just a way to tell the user that a better/safer function is available for a function which he is using! For e.g. strcpy. If you use strcpy in VC8 we’ll get a warning saying that it’s deprecated, instead use strcpy_s which is the secure version of this API. So the […]
Continue reading…

 

Saving value of a MACRO( #define ) before redefining!

Use push_macro and pop_macro to save and restore the value of a macro before redifining the same to some other value. Here is a sample from MSDN… [sourcecode language=’cpp’]// pragma_directives_pop_macro.cpp // compile with: /W1 #include #define X 1 #define Y 2 int main() {    printf(“%d”,X);    printf(“n%d”,Y);    #define Y 3   // C4005    […]
Continue reading…