We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
inline makes defined function as a copy-paste code, i.e. it suggest to compiler that "You can replace this code, instead of calling it as a function.". Let me explain with an example. We code this program:
When you compile this code, your code suggest to your compiler that "It's a good idea if you replace print function with it's code, huum?" and based on situation, if compiler accepts this suggestion, code will converts to this:
This optimision feature of C++ in many situations is a good solution instead of using macros. It will reduce overhead of program, but this also has some disadvantures that you can find them with search on google :D.
Preprocessor Solution
You are viewing a single comment's thread. Return to all comments →
inline
makes defined function as a copy-paste code, i.e. it suggest to compiler that "You can replace this code, instead of calling it as a function.". Let me explain with an example. We code this program:When you compile this code, your code suggest to your compiler that "It's a good idea if you replace
print
function with it's code, huum?" and based on situation, if compiler accepts this suggestion, code will converts to this:and then compiled.
This optimision feature of
C++
in many situations is a good solution instead of using macros. It will reduce overhead of program, but this also has some disadvantures that you can find them with search on google :D.If any explaination is required, I'm here ;).
God Damn. You are the hero and teacher we need but don't deserve.
lol stop being emotional :p
:-D
i know right.
Dude! You are awesome! I leraned a lot from your comments! Thank you!!!! xD
Thanks a lot ,friend
Best explanation..Thanks a lot Meysampg
Thanks dude. You are awesome!
thanx.respect from india
thanks a lot :)
This made my day.. Thank you so much
Thank you so much Sir!!