My methods loop does not want to stop even if i use return
I have tried different ways but i cant get to making it just exit
11 Replies
main
That loop will indeed never stop
You can't stop that loop from inside VisaMeny
frick
You will need to inspect the return value from VisaMeny inside your main looo
can i use continue in main?
to skip but it wont work prob
continue;
is a loop instruction, it means "start the next iteration of the loop right away"
in your main method, that wont do much
in fact, why is your main doing while(true)
?
VisaMeny handles the menu interaction
when it returns, the user has selected something
if you want to show the same menu again and again until the user picks a certain something, handle that with an if(VisaMeny() == StoppaProgrammet) return;
i moved stuff from main to the second file and forgot about that
easy fix then 🙂
just remove the outer loop
i fogor lamo
lmao