CodeBlocks is a free C/C++ IDE for both Windows and Linux.
Windows: install CodeBlocks using a binary file "mingw-setup".
Optionally, you can also set the "Settings" -> "Compiler...".
Follow the "learncpp" guide, chapters 0.x on how to setup "Compiler...".
Optionally, you can also set the "Settings" -> "Editor..." -> "Source Formatter".
Java with the following options checked works for me:
- indent size : 2
- convert TABs to spaces
- pad around operators
- pad between a header and the following paren
- remove extra padding
- padding after commas