It explicitly says in the c++ standard documentation that a program may not call main. Yet I wrote a program that calls main and works perfectly fine, why is that? The code:
#include<iostream>
static int counter = 0;
int main(){
counter++;
std::cout << counter << " It works" << std::endl;
while(counter < 10){
main();
}
return 1;
}
It prints to console "It works" 10 times. According to the standard documentation, this should not work, yet it works. What's going on?