User forums > Using Code::Blocks

C exe file crashing

(1/1)

pion:
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!

stahta01:
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.

pion:

--- Quote from: stahta01 on August 30, 2021, 12:34:06 pm ---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.

--- End quote ---

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

pion:
I found a solution!

After searching on other forums, writing "system("pause") before the return statement worked.

Commaster:
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)

Navigation

[0] Message Index

Go to full version