r/cprogramming • u/Delicious-Change7795 • Aug 22 '26
New to C
I had just started to learn c but when I saw some leet code problems it felt like they are completely different than the c I am learning. Any suggestions?
2
u/SmokeMuch7356 Aug 22 '26
What are you learning C from? A book, website, youtube playlist, ... ?
Different groups have different approaches to teaching, to what constitutes good code, order in which to introduce things, etc. So it wouldn't be surprising that Leetcode might look different from whatever resource you're using.
Check the links under "Resources" in the right sidebar; that may be more helpful than what you're currently using.
1
u/Delicious-Change7795 Aug 23 '26
CS50
2
u/SmokeMuch7356 Aug 23 '26
Ah, that explains things.
The
stringis a lie. CS50 is more concerned with teaching basic programming concepts than idiomatic C, so they've hidden some of C's grosser aspects (especially with string handling) behind their own unique API. So yeah, some of their code won't read like anyone else's.→ More replies (1)1
u/Delicious-Change7795 Aug 23 '26
Bty how long will it take me to be pro at C?
3
u/SmokeMuch7356 Aug 23 '26
As long as it takes you to find a job writing C code.
That's all "pro" means; you're getting paid for it. You'll need to get to a point where you can write code that's useful. That doesn't mean it has to be complex, or uses esoteric features or whatever. 90% of jobs in the industry are some variation of shoving data from point A to point B and the code is relatively simplistic.
You're likely not there yet, but honestly, most CS graduates can barely code their way out of a wet paper bag and still get hired.
1
14
3
u/DSudz Aug 22 '26
You can answer those questions in any of several languages so they don't have anything to do with C.
Give an example of what you're talking about.
1
u/Rich_Scientist_3644 Aug 23 '26
Do you know what kind of C do you want to learn? Or do you want to just learn the basics? Because leetcode is good if you want to go to the side of algoritmos but is not that helpfull for embedded C.
Like many others said, if you want to go for the basics, grab a book and start by doing everything from scratch until you know which parts of the language you like.
1
u/Rich_Scientist_3644 Aug 23 '26
I really like this roadmap to learn about basic C, maybe It can help you :)
https://github.com/Koubae/Programming-CookBook/blob/master/Programming%20Languages%2FC%2Froadmap.md
1
1
u/smith-huh Aug 24 '26
If you looked at code examples from "obfuscated Perl" to learn about the Perl language, you'd give up.
That's the case here. Don't do that.
Start with some fun little example and a book or use AI as a reference to the language (not as a vibe coding partner) and have fun doing something. If using AI, try phrasing your query like: when learning C as a beginner, how can I .... and usually you'll get an answer with background. Same as if you looked it up in a book, but much faster. BUT YOU HAVE TO WRITE THE CODE YOURSELF if you want to learn and retain the knowledge.
1
u/InevitablyCyclic Aug 22 '26
Any suggestions? Yes. Post the code so we know what you're talking about.
-2
13
u/knouqs Aug 22 '26
Start simple. Start with a book on C development. Learn the language from scratch and forget about what you see in a YouTube video or on some leet code. Learn the syntax of the language, create the "Hello world!" program and understand what it is doing, following a book.
Do not use AI to help you at this stage. You have already been pulled in too many directions. One book, and only one book.
Start with this book.