I'm trying to understand recursion and stack overflows.
First, why does this not cause a stack overflow? Is it because the function returns every time and that the stack isn't populated upon each call?
void Meh()
{
}
int main()
{
while (true)
Meh();
}
Two, What is the difference between the two below? They both seem the exact same to me except one uses a base function aka the forward declaration and the other calls itself.. Will both of them result in the same stack overflow? Will they BOTH overflow at all? Both never seem to return to me so the Bleh recursion should overflow exactly like Meh's?
void Meh()
{
Meh();
}
//Versus..
void Bleh(); //Forward Declaration.
void BaseR()
{
Bleh(); //Call the forward..
}
void Bleh()
{
BaseR(); //Call the base..
}