So, I've written a C executable on Linux for Windows using mingw32-gcc. It is a basic Input-Output program, you type an input and get an answer. Problem is the cmd shuts down immediately, so the user can't see the output.
Assuming I cannot use Windows to edit the executable there, what should I change in my code/ what flags should I use when compiling it?
inb4:
- the user is supposed to click and run it, so running it from cmd won't help.
- adding getchar()/scanf() at the end of my code doesn't work, and it feels a bit like cheating.
SOLVED: so all I had to do was to actually add a getchar() after every scanf() and one more at the end of the code for the user input to close the cmd.