C++ Programming - OOPS Concepts - Discussion
Discussion Forum : OOPS Concepts - General Questions (Q.No. 43)
43.
Which of the following statements regarding inline functions is correct?
Discussion:
12 comments Page 1 of 2.
Ayesha... said:
5 years ago
If we used too many inline function resultant in a larger code size than it may cause thrashing in memory. More and more number of page fault bringing down your program performance.
(1)
Jyoti said:
9 years ago
What is inline function?
Abi said:
9 years ago
Please give a example code which contains an inline function.
Vyshnavi said:
9 years ago
It speed's up the execution but how it increases the code size?
An inline function is a function which is expanded in a line when it is invoked.
An inline function is a function which is expanded in a line when it is invoked.
Ashish Harsora said:
1 decade ago
Inline function increases speed of execution because it store memory location at the first time after that it calls the function many times without refer the memory location.
(1)
Smriti said:
1 decade ago
How does it increases the code size? someone please explain.
Renu said:
1 decade ago
How it increase code size ?
Kushal Tewatia said:
1 decade ago
Why it is different from macro?
Manisha said:
1 decade ago
Inline function is used only when our code is small.
When inline function is called, then the definition of called function is attached with the calling function.
It fast the execution speed, because our program run in sequence order. There is no jumps no branching.
So, definitely program's code size increases still, it fast the execution speed.
When inline function is called, then the definition of called function is attached with the calling function.
It fast the execution speed, because our program run in sequence order. There is no jumps no branching.
So, definitely program's code size increases still, it fast the execution speed.
(1)
Johan braanen said:
1 decade ago
"It speeds up execution. " Is not always correct.
If you have a very big function, and want to call it a million times, performance would degrade if the CPU would have to load the new instructions form memory instead of using the cache.
If you have a very big function, and want to call it a million times, performance would degrade if the CPU would have to load the new instructions form memory instead of using the cache.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers