What is difference between template and macro??

What is difference between template and macro??

The macro is expanded without any special type checking.Its expanded by the prepocessors. And It will show up in expanded form during debugging.  If macro parameter has a postion incremented variable ( like c++ ), the increment is performed two times.Because compiler error messages will refer to the expanded macro, rather than the macro definition itself.

By:Umang
Date:2006-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related C Subjective Links

C Subjective interview questions and answers for experienced and fresher