what is inline function?
Answers were Sorted based on User's Feedback
Answer / vishnu
Inline fuction is one which has one line of defination.
If function definiation is more than two lines of
defination it will be treated as normal fuction.
since it will be replaced at compile time it is good to use
inline function if your code is of one line
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / anoop raj
The point of making a function inline is to hint to the
compiler that it is worth making some form of extra effort
to call the function faster than it would otherwise -
generally by substituting the code of the function into its
caller. As well as eliminating the need for a call and
return sequence, it might allow the compiler to perform
certain optimizations between the bodies of both functions.
Sometimes it is necessary for the compiler to emit a
stand-alone copy of the object code for a function even
though it is an inline function - for instance if it is
necessary to take the address of the function, or if it
can't be inlined in some particular context, or (perhaps) if
optimization has been turned off. (And of course, if you use
a compiler that doesn't understand inline, you'll need a
stand-alone copy of the object code so that all the calls
actually work at all.)
There are various ways to define inline functions; any given
kind of definition might definitely emit stand-alone object
code, definitely not emit stand-alone object code, or only
emit stand-alone object code if it is known to be needed.
Sometimes this can lead to duplication of object code, which
is a potential problem for following reasons:
1. It wastes space.
2. It can cause pointers to what is apparently the same
function to compare not equal to one another.
3. It might reduce the effectiveness of the instruction
cache. (Although in lining might do that in other ways too.)
Is This Answer Correct ? | 0 Yes | 0 No |
Tell us the use of fflush() function in c language?
main() { int x, arr[8]={11,22,33,44,55,66,77,88}; x=(arr+2)[3]; printf(“%d”,x); }
What kind of structure is a house?
What are the different types of C instructions?
What is the output of following program ? int main() { int x = 5; printf("%d %d %d\n", x, x << 2, x >> 2); }
What does dm mean sexually?
How can you determine the size of an allocated portion of memory?
When can you use a pointer with a function?
How do I get an accurate error status return from system on ms-dos?
Write an implementation of “float stringToFloat(char *str).” The code should be simple, and not require more than the basic operators (if, for, math operators, etc.). • Assumptions • Don’t worry about overflow or underflow • Stop at the 1st invalid character and return the number you have converted till then, if the 1st character is invalid return 0 • Don’t worry about exponential (e.g. 1e10), instead you should treat ‘e’ as an invalid character • Write it like real code, e.g. do error checking • Go though the string only once • Examples • “1.23” should return 1.23 • “1a” should return 1 • “a”should return 0
int x=5; printf("%d%d%d",x,x<<2,x>>2);
how to find anagram without using string functions using only loops in c programming