UnhappyCommands

Posts 1–3 of 3 · Page 1 of 1
Commands
hey people i try to make another command but it don't work i have stringed it btw

Code:
//HELP
if(line == "/help")
{
cout<<"command list\n /info - information of program\n /help - list of commands"<<endl;
main();
}
else
{
cout<<"Failed To Get Command"<<endl;
main();
}

//info
if(line2 == "/info")<--- This Don't Work
{
cout<<"test line1"<<endl;
main();
}
else
{
cout<<"test line2"<<endl;
main();
}
thanks
edit: wasn't paying attention. That line of code never gets called, and here's why:
Code:
if(line == "/help")
{
cout<<"command list\n /info - information of program\n /help - list of commands"<<endl;
main(); // GO TO MAIN
}
else
{
cout<<"Failed To Get Command"<<endl;
main(); // GO TO MAIN
}
...
main()
^^No Matter what, this code only has 2 options..or 1 really

The code never RUNS the 2nd if statement, because of the first one
If the input isn't "/help", the code just calls main...
where it checks for "/help" ELSE call main...
where it checks for "/help" ELSE call main..
forever and ever.
ok thanks .
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us