What is difference between #define and const?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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?

1414


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

1658


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1625


class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash

1703


How to hide the base class functionality in Inheritance?

642






What is difference between inheritance and polymorphism?

577


What are oops methods?

568


explain sub-type and sub class? atleast u have differ it into 4 points?

1840


What is persistence in oop?

677


What is abstraction and encapsulation?

577


Are polymorphisms mutations?

707


Explain virtual inheritance?

688


Why is polymorphism used?

588


What language is oop?

599


Why do we use encapsulation in oops?

529