I am running this code on a Codeblocks compiler and on an online compiler. The Codeblocks compiler goes in an infinite loop printing infinite "-----" while the online compiler runs it correctly. I am using the GNU GCC Compiler in CodeBlocks, I don't know to which compiler I should change it to or plugin to add to make the code run.