On windows Visual Studio (NOT VSCode, it merely shares the name and icon) is the most complete package you can get. You need to click the correct two things during installation and another 2 things when setting up a project but thats it. Cant really go wrong.
CodeBlocks supposedly is fairly easy to use/install as well (assuming you install the version that comes with a compiler).
The new versions of DevC++ offered by embarcadero probably also works pretty well. Dont use any other version of DevC++ though, they are all abanonded and out of date.
On mac you would probably go with XCode or Eclipse.
On linux you cant go wrong with CLion (if you can get a license). Eclipse is also availible. I used to use KDevelop, which rather liked (though i have no idea how easy it is to use without CMake)
See also: https://www.learncpp.com/cpp-tutorial/installing-an-integrated-development-environment-ide/
> I'm learning c++ using dev c++ as compiler.
Dev-C++ is an IDE. It's usually set up to use some variety of the MinGW compiler, which is a Windows port of the GCC compiler. Hopefully you're using the Embarcadero release of the compiler, because the Orwell and Bloodshed releases are rather old.
What you're seeing is the expected behavior. Windows opens a command prompt, runs the program, and closes the prompt when the program execution ends. For a simple program like you're probably writing early on, I'd either start cmd
and run the program from there (so the window doesn't disappear), or add something like std::cin.get();
before the end of your main
, so that you have to press enter to make the program exit.
> Dev c++
Hopefully the up to date version: https://www.embarcadero.com/free-tools/dev-cpp ?
> Zebra *z[10];
This declares an array of pointers to zebras This array is on the stack. This array must not be deleted.
What you have to delete are its elements:
for ( auto ptr : z ) { delete ptr; }
The exact same applies to the c
array.
> new
You really dont need to use this.
use a std::vector<Zebra> z
and then do
z.emplace_back( name, age, ns )
No new
, no delete
, no problems.
So: Most versions of Dev-C++ are ancient. There've been like...3 or 4 different maintainers over the years. If you insist on using Dev-C++, go with Embarcadero's version. It's at least packaged with a version of G++ that's just from 2019 and properly supports Windows 10. Their latest update was published January 2021.
As other comments mention, the "best of class" on Windows is going to be Microsoft's offering.
Code::Blocks is native.
Dev-C++ was native and (via sponsoring from Embarcadero) it has recently been updated:
https://www.embarcadero.com/free-tools/dev-cpp
​
>Embarcadero Dev-C++ has a low memory footprint because it is a native Windows application and does not use Electron.
You installed one of the versions that's packaged with a compiler, right? For the version that you're using, this would be the appropriate link.
However, that version is also almost 6 years old at this point. Embarcadero recently released an updated version, including GCC 9.2.0 instead of GCC 4.9.2 (and that's ignoring that Dev-C++ hasn't been considered especially good in a long time).