a in c there is a main difference among a


A: In C++ there is a main difference among a template and a macro. Merely a macro is a string which the compiler replaces along with the value that was defined. For example #define STRING_TO_BE_REPLACED "ValueToReplaceWith"

A template is a method to make functions independent of data-types. It cannot be accomplished via macros.

For example a sorting function doesn't have to care whether it's sorting integers or letters as the same algorithm might apply anyway.

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: a in c there is a main difference among a
Reference No:- TGS0218241

Expected delivery within 24 Hours