Answer Posted / subrat pattnaik
1.In Inline function if the codes are too much it acts as
normal function(without expanding in a line it gets jumps to
fun defination) but this is not with macro(it gets inserted
were it is calleed without checking its bulkness).
2.Suppose
#define square(x) (x*x)
inline void SQUARE(int x)
{
x*x;
}
void main()
{
a=5;
cout<<"The square is "<<square(++a);
cout<<"The SQUARE is "<<SQUARE(++a);
}
Here in macro it will b ++a * ++a(a incrementing 2 times)
In inline it will get incremented and is squared(++a)^2
Thanks
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
What is binary object model?
What is struct c++?
How do you compile the source code with your compiler?
Which operator cannot overload?
Write a program using display() function which takes two arguments.
What is null and void pointer?
What is pure virtual function?
How c functions prevents rework and therefore saves the programers time as wel as length of the code ?
How does list r; differs from list r();?
What is the difference between map and hashmap in c++?
How do I get good at c++ programming?
Why do we use setw in c++?
How do you master coding?
Is c++ pass by reference or value?
Does c++ have a hash table?