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

What operators can you overload in c++?

675


Is c++ a high level language?

643


State two differences between C and C++.

706


Where is atoi defined?

657


Is it legal in c++ to overload operator++ so that it decrements a value in your class?

697






the maximum length of a character constant can be a) 2 b) 1 c) 8

716


Can constructor be private in c++?

713


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

710


Which software is used to run c++ program?

625


Which field is used in c++?

723


What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard

691


What is auto used for in c++?

667


When there is a global variable and local variable with the same name, how will you access the global variable?

730


What is c++ w3school?

738


Is set c++?

658