C function memory allocation

后端 未结 3 621
栀梦
栀梦 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:45

    The memory for C functions is always allocated from the code segment at the time the functions are loaded into memory. If a function belongs to a dynamically linked library, the program may load and unload it at arbitrary times.

提交回复
热议问题