New course! Every coder should learn Generative AI!
Try a free lesson+ 3
can we use all macros in cpp,like #define
2 Answers
+ 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.