Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: pion on August 30, 2021, 11:34:08 am
-
Hello,
I've been using Codeblocks for a few weeks now and noticed something weird. Whenever I try to run a .exe file, it crashes. Sometimes it works fine at the start, but crashes after taking user input. I am coding in C and using Windows 10. I guess it has something to do with the compiler? I'm still a beginner at C, so please don't use too complicated explainations. Thanks!
-
Your program likely has a bug in it that causes it to crash.
I suggest finding an website that helps beginners learn how to code and post your code on that site.
Edit: The above is assuming your program is crashing.
Tim S.
-
Your program likely has a bug in it that causes it to crash.
I suggest finding an website that helps beginners learn how to code and post your code on that site.
Edit: The above is assuming your program is crashing.
Tim S.
Thanks for the reply,
This applies for all of my programs, even to a simple Hello World program. The code works fine in the IDE
-
I found a solution!
After searching on other forums, writing "system("pause") before the return statement worked.
-
So it wasn't crashing, just successfully finishing and closing itself...
Code::Blocks merely asks the terminal to stay open after your application is finished.
You can try opening a terminal first and then launching your app from inside it. (Instead of double-clicking the executable)