What is the difference between #define and const? Explain with suitable example.
Answers
Answered by
1
The difference is that #define is processed by the preprocessor doing what amounts to simple text replacement. Const values definedlike this are not visible for the actual compiler, while a variabledefined with the const modifier is an actual typed "variable" (well not really that variable).
Similar questions