can we use all macros in cpp,like #define | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 3

can we use all macros in cpp,like #define

29th Mar 2017, 12:30 PM
shivajiuser@
shivajiuser@ - avatar
2 Réponses
29th Mar 2017, 3:13 PM
Hatsy Rei
Hatsy Rei - avatar
+ 3
yes you can, but inline functions and template function are better options over macros. 1. Inline functions ensure datatype binding. 2. Template functions facilitate generic programming.
29th Mar 2017, 12:39 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar