difference between macro and function?

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


Please Help Members By Posting Answers For Below Questions

Will rust take over c++?

594


Can we get the value of ios format flags?

660


What is difference between c++ and c ++ 14?

578


What is the basic structure of a c++ program?

614


Which field is used in c++?

638






Are iterators pointers?

677


What is meant by the term name mangling in c++?

519


Is string an object in c++?

657


what are the types of Member Functions?

615


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

734


Which ide is best for c++?

540


Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

1511


Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort

660


What is while loops?

617


What is the difference between global variables and local variable

536