3 ms·
My usual recommendation is to work through K&R, which is how I learned C nearly 20 years ago as a high school senior taking an introductory C course at a commun
by linguae 2y ago
My usual recommendation is to work through K&R, which is how I learned C nearly 20 years ago as a high school senior taking an introductory C course at a community college. I still think this is a well-written book that will teach you the basics of C.
However, K&R was last updated when the ANSI C standard was ratified, and there has been many important changes to C since then. Moreover, there are important safety concerns that need to be taken to account with coding in C, such as opting for functions like strlcpy for copying strings instead of the classic strcpy or the better-but-still-dangerous strncpy.
Once you are familiar with C, I then recommend learning some Unix system calls. I highly recommend looking at the source code of Unix utilities, and I also recommend textbooks such as Advanced Programming in the Unix Environment to learn more about Unix system calls.
When I was an undergrad at Cal Poly San Luis Obispo over 15 years ago, all computer science majors were required to take an intensive course on Unix systems programming in C. We built many projects, such as HTTP servers and shells. I highly recommend building projects like these to get very proficient in C.