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?
8
Upvotes
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.
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.
14
u/mc_pm Aug 22 '26 •
For one, don't go to leetcode for learning C. That's just crazy.
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/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
u/Traveling-Techie Aug 22 '26
Read up on what “Turing complete” means.