Maybe you can change the settings that NetBeans uses to call gcc. I haven't programmed in C for a long time, so I don't know how to do that, but it's probably not hard to find in the preferences of NetBeans. When calling gcc from the command line, it's usually a good idea to use
-Wall (which means: turn on all warnings), for example:
gcc -Wall hello.c -o hello
I'm sorry but I don't have a good book recommendation for C - I learned C a long time ago, on the
Amiga when I was 16 or so.