What is difference between #define and const?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is the main purpose of inheritance law?
How to improve object oriented design skills?
what uses of c++ language?
what is the main difference between c and c++?
386 Answers AZTEC, B.Tech, CMC, College School Exams Tests, HCL, IBM, ITM, Khalsa Institute, Microsoft, Oracle, Sanjeevni Institute, TCS, Tech Mahindra, Wipro, ZeOmega,
what is graphics
What is a class?
32 Answers Infosys, TCS, Thylak,
what is multi level inheritance give n example ?
13 Answers HDFC, Hulas Steel, Ness Technologies,
Why polymorphism is used in oops?
write a program in c++ to overload the function add (s1,s2) where s1 and s2 are integers and floating point values.
You have one base class virtual function how will call that function from derived class?
What is encapsulation oop?
what is costructor?