In C++ following is used instead of #define in C

Options
- Const
- Regular
- Static
- Dynamic


CORRECT ANSWER : Const

Discussion Board
Its not totally correct.

The values of macros can''t be changed. So maybe they are saying that const is equal to #define.
But Macros and inline functions are just the same so I think that inline should be given as an option.

Divya Nesana 08-1-2020 08:20 AM

Not really correct question and answer.

Constant variable modifier can not be used instead of precompile directive. They have completely different purpose. And as long as I know, we have const in C..

EduardK 08-11-2015 10:12 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement