Computer Science, asked by pratikpandya458, 1 year ago

What is the difference between #define and const? Explain with suitable example.

Answers

Answered by MS903
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