program 1
#include <iostream>
std::size_t three() {
return 3;
}
int i[three()];
int main()
{
return 0;
}
program 2
std::size_t three() {
return 3;
}
int main()
{
int i[three()];
return 0;
}
The issue here is Program 1 as expected gives the compilation error
"error: array bound is not an integer constant before ']' token"
But I have no idea why the Program 2 is compiled successfully?