#include int foo(){ return 1; } int main(void) { static int q = foo(); return 0; }
Here is a link for the same. This i
If you are doing this in C rather than C++ you can only assign static variables values that are available during compilation. So the use of foo() is not permitted due to its value not being determined until runtime.