What is difference between #define and const?

Answers were Sorted based on User's Feedback



What is difference between #define and const?..

Answer / sarath

#define is the macro,const is modifier forexample const is
used in theb program we can not modify the data

Is This Answer Correct ?    10 Yes 1 No

What is difference between #define and const?..

Answer / sirin

#define MAX 100 - create constant with no type information
const int max = 100 - with type information

Is This Answer Correct ?    6 Yes 0 No

What is difference between #define and const?..

Answer / chitransha seth

with # define u can always undefine the variable by using
# undef but a const once defined cannot be altered

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More OOPS Interview Questions

What is constructor overloading in oop?

0 Answers  


which is best institute to learn c,c++ in ameerpet hyderabad

1 Answers  


What does the keyword "static" mean?

4 Answers   TCS,


wht is major diff b/w c and c++?

10 Answers  


What type of Job you are providing?

0 Answers  






what uses of c++ language?

3 Answers  


What is the main feature of oop?

0 Answers  


what is difference between class template and template class?

0 Answers  


Why polymorphism is used in oops?

0 Answers  


Iam doing my project on instant messaging , if you any new ideas regarding this project ,please suggest it?

2 Answers  


What is encapsulation oop?

0 Answers  


What are the different forms of polymorphism??

8 Answers   Mantaq, NUC, PCS,


Categories