I've seen professionals make the same mistakes as you are (heck, I slip now and then

). I think it is because they never sat down and learned what exactly is going on "under the code".
I would recommend going online and reading some guides on how C allocates memory (since Lite-C follows most of the same rules) and learn this now. You'll save a ton of time debugging later on (and you'll impress people at job interviews

).