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 design patterns in C++?

2 Answers   Persistent,


What is cohesion in oop?

0 Answers  


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

0 Answers  


write a program that takes input in digits and display the result in words from 1 to 1000

0 Answers   Wipro,


What does and I oop mean in text?

0 Answers  






what is the virtual function overhead, and what is it used for ? i hope i can get and appropriate answers, thanks a lot....

6 Answers  


Why do pointers exist?

0 Answers  


Describe the difference between a Thread and a Process?

11 Answers   Siebel Systems,


Difference between vector and array

2 Answers  


what are the realtime excercises in C++?

0 Answers   IBM, Wipro,


Why is there no multiple inheritance?

0 Answers  


What is stream in oop?

0 Answers  


Categories