Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Learning C coming from managed OO languages

I am fairly comfortable coding in languages like Java and C#, but I need to use C for a project (because of low level OS API calls) and I am having some difficulty dealing with pointers and memory management (as seen here)

Right now I am basically typing up code and feeding it to the compiler to see if it works. That just doesn't feel right for me. Can anyone point me to good resources for me to understand pointers and memory management, coming from managed languages?

like image 996
Aillyn Avatar asked Sep 22 '10 04:09

Aillyn


2 Answers

k&r - http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)

nuff said

like image 173
gmarcotte Avatar answered Sep 20 '22 13:09

gmarcotte


One of the good resources you found already, SO.

Of course you are compiling with all warnings on, don't you?

Learning by doing largely depends on the quality of your compiler and the warnings / errors he feeds you. The best in that respect that I found in the linux / POSIX world is clang. Nicely traces the origin of errors and tells you about missing header files quite well.

like image 43
Jens Gustedt Avatar answered Sep 22 '22 13:09

Jens Gustedt