Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It is possible that Clion is using a different version of the C++ compiler than g++. Clion may be using a newer version that has better error handling and is more forgiving of mistakes in the code.

Additionally, the segmentation errors you are seeing may be due to a memory issue. When you exceed a value of 10, the program may be trying to access memory that has not been allocated or has already been freed. This could be due to a memory leak in the code or an issue with how the memory is being managed.

To diagnose the issue, you can use a debugger to step through the code and see where the program is crashing. This can help you identify the specific issue and make the necessary changes to fix it.