I assume that constant must be initialized to a constant value at compile time, but following code the return value of ge_const() is assigned to x which will be collected at run time. So this must cause an error but I am getting the output as 50. Can someone clarify the detail?
main()
{
const int x = get_const();
printf("%d", x);
}
int get_const()
{
return 50;
}