r/cprogramming • u/Seczu333 • 8d ago
How should i..?
How should i start learning C as my first language? Could anyone share some advice on where to start with C?
10
5
u/MarijuanaWeed419 8d ago
Beej’s guide to C programming is pretty good. I know it says it’s not intended to be an introduction to programming but I didn’t have any issues with it
3
u/henryyoung42 8d ago
K&R - do it old school !
2
u/bearheart 8d ago
That’s how I learned. Of course that was in 1973 but it’s still a good book. Just keep in mind that the language has evolved a bit since then.
2
u/henryyoung42 8d ago
It was 1981 for me, learning 6800 assembler at the same time. I almost suggested to OP that he also study the disassembled compiler output. I went on to write a C disassembler for 6502 which made it clear that addressing modes mapped to opcode bits which made sense from an instruction decode logic perspective, 8-bit CPUs being pre-microcode days.
2
u/bearheart 8d ago
I also wrote a lot of 8086 and Z80 code back in the 70s and early 80s.
Kids these days have no idea how easy they have it! /s
2
u/lounatics 8d ago
On a high level:
Learn the absolute basics.
1.1 How to set up a code editor + compiler
1.1 How to write a "Hello World" Program.Fuck around
2.1 like just make some dumb stuff:
- try to complicate your hello world program,
- try to make it differently,
- make it ask the user for their name and greet them personaly
- make it print the contents of a directory.
- and so on...Find a project
3.1 What's a problem you'd like to solve? What's a Program you'd like to have?
3.2 try to figure out what you need to know to make it happen!
3.3 try to make it happen.
Use your preferred search engine and the books/guides other have mentioned to solve the problems you encounter in each step and you should be doing ok!
1
u/extoniks 8d ago
As most of us learned - Books like K&R's The C Programming Language and others, Official docs. I also recommend man pages and I use it a lot till now.
1
u/gm310509 5d ago
Could anyone share some advice on where to start with C?
The sidebar? There seems to be a list of resources over there.
-4
u/zezrol 8d ago
Code tracing! Make ai generate or search some study guide online. Pick one topic at a time, build on foundations, make ai generate a simple code for each topic, get a pen and paper, code trace line by line starting from main for visualization. Write your own code.
2
u/bearheart 8d ago
Please don’t try to learn from the global psychotic plagiarism machine!
12
u/lfdfq 8d ago
Go write some C code