How expensive are function calls in C or C++?
I think not that much. I think that, as the computer knows the address of the function, it is the price of some jump statements in assembly. The only thing is that C++ uses templates that can be expensive compared to a C function, if they are called many times with different types.
function calls become expensive only when people uses them is very unstructured manner. If you never look where you are trying to bring up the link then you are certainly in deep trouble.also function calls improve modularity ,and reuse of code...but not always it is positive....sometimes it may make code very combersome....so at the bottom line i would say it is very tuff to judge the expence in general...but to a particular code one can definately find that
Join our real-time social learning platform and learn together with your friends!