Oct 11, 2018 at 4:19pm
1 2 3 4 5 6 7 8 9 10
|
if (selection == 'y')
if (selection == 'Y')
{
main();
}
if (selection == 'n')
if (selection == 'N')
{
exit(0);
}
|
This is just plain all wrong. In many ways.
Here it is, less wrong:
1 2 3 4 5 6 7 8 9
|
if (selection == 'y' || selection == 'Y')
{
main();
}
if (selection == 'n' || selection == 'N')
{
exit(0);
}
|
but this is still wrong.
You must NEVER EVER call
main()
. It's forbidden in C++. You are not allowed to call
main()
.
You should not be calling
exit()
. You should be ending this program by
return
from
main()
.
Last edited on Oct 11, 2018 at 4:20pm