What are the advantages and disadvantages of using inline
and const?

Answer Posted / nidhi singh

advantages of inline-no function calls need to be
generated.no stack required.
disadvantage -inline functions require more space..
the whole definition is copied.
by using const we insure the value of variable is not goin
to change..

Is This Answer Correct ?    42 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can constructor be private in c++?

606


What are advantages of using friend classes?

634


What are stacks? Give an example where they are useful.

594


What is prototype for that c string function?

692


What operators can you overload in c++?

594






What is the history of c++?

557


If you want to share several functions or variables in several files maitaining the consistency how would you share it?

554


What are friend classes? What are advantages of using friend classes?

608


What is istream and ostream in c++?

598


Describe about storage allocation and scope of global, extern, static, local and register variables?

735


Do vectors start at 0 c++?

535


What is a constant? Explain with an example.

558


What do you mean by stack unwinding in c++?

732


Does c++ have arraylist?

540


total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.

2081