How do I stop my program from exiting in C?
I tried some things like:
return 0;
system ('PAUSE');
the thing i do is put a scanf(); at the end and he waits an input but that looks terrible.
How do I stop my program from exiting in C?
I tried some things like:
return 0;
system ('PAUSE');
the thing i do is put a scanf(); at the end and he waits an input but that looks terrible.
in your example, the call to system() will never happen, because you're returning before you get there. If you put the "return 0" after the system() call, it will work as you expect. Return is unconditional. Nothing gets executed after a return statement.
What can this strange device be?
When I touch it, it gives forth a sound
It's got wires that vibrate and give music
What can this thing be that I found?
Thanks!
Run program in command line.
Our goals are clear, tasks are defined! Let's work, comrades! -- Nikita Khrushchev