There is also the matter that it's NOT C++... I notice that you are typecasting the return from malloc(), probably to stop the compiler from complaining about it... that tells me you've never yet written a pure C program because you are using GCC in C++ mode... you may be typing in C source code but you are compiling C++ programs... and yes there is a difference.
Incompatibilities Between ISO C and ISO C++ ... and do note this is a very long page!
I'm aware that GCC (newer versions) can be forced in to C-89 compliance and C-99 may be there as well... but it's fairly obvious you aren't doing that.
My thinking is that if you are going to learn C programming ... you need to learn C not C++ .... and Pelles C is pure C... no C++ codesmut anywhere to be found.
Secondly, there's the little matter of documentation... In my opinion GCC is well enough documented for an experienced programmer to use, that is you can get documentation for it but it's not generally included with 3rd party distributions like DevC++ or Code::Blocks.
Ever noticed how often I suggest that people look something up in their "C Library Documentation"? For most people that means either fishing the web trying to find information, going out and downloading huge html files that are poorly organized, relying upon Generic help files or flatout having to guess... In Pelles C... just press F1.
Pelles C comes with a help file that details every function in it's (rather extensive) library, clearly identifies each as standard C or not and gives full information about all aspects of the IDE, Compiler, Linker etc. All nicely available on the main menu. Keyword help is available by simply placing your typing cursor on any coloured keyword and pressing F1 ... perfect for a beginner who's still trying to master the syntax and still plenty helpful for an experienced programmer who's looking for a reminder about standards and nuance.
Then there's the matter of advanced programming such as Windows API. Pelles C comes with a complete set of resource editors (menus, dialogs, accellerators, icons, bitmaps, etc.) built into it's IDE and these are essential tools for anyone writing GUI mode programs... it also has the only 3rd party Message Table editor I've ever seen. The Dev ide has limited set, Code::Blocks has none.
Now don't get me wrong, I'm no compiler fanboi... if a better compiler and/or a better language comes along... I'm there. I actually don't much like C or C++ for all kinds of reasons... but in my quest for better I have so far always ended up back on Pelles C.... So it's the best recommendation I can give at the moment. (and now you know why)