Answer Posted / utpal kumar kashyap
Hi to Everyone,
See, inline function is a function whose code get inserted instead of jump to the function where it was called.
We can make any function as inline but there are few conditions in which compiler will not treat it as inline function....
If
1. Function contains any static variable.
2. It recursive.
3. Function code is large.
However, if function body is large and in this case if we try to make it as inline, then compiler wont give an error, but compiler would treat it as normal function. So idea is this, function code should be small for making it inline.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Which one is better- macro or function?
Specify some guidelines that should be followed while overloading operators?
If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?
Is c++ pass by reference or value?
Is swift faster than c++?
What is set in c++?
Which is the best c++ compiler for beginners?
Describe private, protected and public – the differences and give examples.
Which is most difficult programming language?
Define 'std'.
How do you clear a map in c++?
What is an undefined reference/unresolved external symbol error and how do I fix it?
Is c++ still in demand?
What is the exit function in c++?
Can we declare a base-class destructor as virtual?