i'm learning about functions and decided to make a loop where two function(in this case funcA
and funcB
) call each other forever but it stops execution after some time.
The code looks like this:
#include <iostream>
void funcA(); //forward declaration
//funcB calls funcA
void funcB()
{
funcA();
}
//funcA prints 1 and calls funcB again
void funcA()
{
std::cout<<1;
funcB();
}
//main calls funcB
int main()
{
funcB();
return 0;
}
the returned value is -1073741571
(0xC00000FD
). can you expain why this happens?