Hi everyone!
I'm trying to write a function in c which will receive a logical sentence and return whether it is legal or not.
My fuction is recursive and at the first call it crashes with the message "Stack overflow" in visual studio.
here is a part of my code:
Code:
char* checkSent(char sent[])
{
int wasBracket=0, brackets=0;
if (sent=='\0')
{
if(brackets)
{
fail();
}
else return sent;
}
sent=checkSent(sent++);
I will appreciate any help or information you can offer me about how to solve this and why this is happening.
Thanks in advance,
Rangid.