Hi forum!
I hope i set this thread in the correct category.
I'm using code::blocks as my IDE in FreeBSD 14.2 STABLE, and when i run code in it, let's say this one:
The code executes correctly, but i can't see the last "cout" output since the terminal window closes too fast, almost immediately.
I've used code::blocks in Debian and Arch and the terminal window wouldn't close immediately, but keep open so you can see the final output of your code.
That made me think this is not an expected behavior, maybe?
I've tried different solutions provided in forums as having the "Pause when execution ends" option toggled on (it is by default).
A temporary fix is adding a "Insert any number to close..." type of function just before the return statement.
And i saw a user saying that is expected that code::blocks closes that way if you don't insert a method to make the program wait by yourself.
But i didn't need that before, and the terminal window just kept open after finishing my code execution in GNU/Linux distros.
Is this a bug or common behavior in FreeBSD? Or maybe am i missing some configuration settings?
I hope i set this thread in the correct category.
I'm using code::blocks as my IDE in FreeBSD 14.2 STABLE, and when i run code in it, let's say this one:
C++:
#include <iostream>
using namespace std;
int main()
{
cout << "Enter a number: ";
int x{};
cin >> x;
cout << "Your number plus 2 is: " << x + 2 << "! \n";
return 0;
}
The code executes correctly, but i can't see the last "cout" output since the terminal window closes too fast, almost immediately.
I've used code::blocks in Debian and Arch and the terminal window wouldn't close immediately, but keep open so you can see the final output of your code.
That made me think this is not an expected behavior, maybe?
I've tried different solutions provided in forums as having the "Pause when execution ends" option toggled on (it is by default).
A temporary fix is adding a "Insert any number to close..." type of function just before the return statement.
And i saw a user saying that is expected that code::blocks closes that way if you don't insert a method to make the program wait by yourself.
But i didn't need that before, and the terminal window just kept open after finishing my code execution in GNU/Linux distros.
Is this a bug or common behavior in FreeBSD? Or maybe am i missing some configuration settings?