Is malloc/calloc evaluated at runtime?


When I compile it, it gives error:
error: initializer element is not constant.

After troubleshooting for a long time, eventually find out that it would work if I put the definition of tests in a function:

After hours thinking and research, I figured that malloc/calloc is evaluated during run time. But global variables and directives are evaluated during compile time.
Therefore, it has to be inside a function.
As the following article states, “malloc (memory allocation) is used to dynamically allocate memory at run time.”