M
Michael Thomas Cassady
I know my subject wasn't the best but I hope people still look at this.
I know that this is probably compiler and implementation dependent and
that this is a standard c discussion group but can someone point me in
the right direction or just answer?
The following code appears to exit abruptly:
#include <stdio.h>
void a();
void b();
int main(int argc, char *argv[])
{
a();
printf ("Hello World!\n");
getchar();
}
void a()
{
b();
printf("H\n");
}
void b()
{
a();
}
Now, I know it cuts off abruptly because in Windows Xp the console
disappears almost instantly, prints nothing out and wiats for no input
at the getchar(). Hence it must abruptly end somewhere in the infinite
recursion of calls, but my question is this:
is this a call stack overflow error? If so, why? I don't pass any
variables, return any variables or have any local variables to store on
the stack... why is it doing this? Thanks
I know that this is probably compiler and implementation dependent and
that this is a standard c discussion group but can someone point me in
the right direction or just answer?
The following code appears to exit abruptly:
#include <stdio.h>
void a();
void b();
int main(int argc, char *argv[])
{
a();
printf ("Hello World!\n");
getchar();
}
void a()
{
b();
printf("H\n");
}
void b()
{
a();
}
Now, I know it cuts off abruptly because in Windows Xp the console
disappears almost instantly, prints nothing out and wiats for no input
at the getchar(). Hence it must abruptly end somewhere in the infinite
recursion of calls, but my question is this:
is this a call stack overflow error? If so, why? I don't pass any
variables, return any variables or have any local variables to store on
the stack... why is it doing this? Thanks