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
Why is the function main() special?
Write some differences between an external iterator and an internal iterator?
what is c++
Explain stack unwinding.
What is the cout in c++?
In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h
What is different in C++, compare with unix?
What is using namespace std in cpp?
What do you understand by zombie objects in c++?
Is turbo c++ free?
What do nonglobal variables default to a) auto b) register c) static
What are c++ stream classes?
How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array?how can you find the nodes with repetetive data in a linked list?
Explain how to initialize a const data member.
Explain rtti.