C function memory allocation

后端 未结 3 623
栀梦
栀梦 2021-01-06 14:48

In C, at what time is a function allocated and where in memory does it go?

Is the memory for a function allocated when the program is compiled first or is it allocat

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-06 15:37

    Inline Function...

    Great Explaination...

    I would like to provide details about the memory allocation for inline function which is not covered. Inline function can be thought of a macro, where the call to the function is replaced by the code and also does the argument evaluation. Giving a key word inline before a function need not make it an inline function, it merely suggests compiler that this is a candidate for inline. The compiler ultimately chooses whether this could be an inline function. Hence the memory allocation would be similar to a function.

提交回复
热议问题