r/cprogramming • • 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

25 comments sorted by

View all comments

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/SLOOT_APOCALYPSE Aug 26 '26

yes! this is the only book!!!!

1

u/Delicious-Change7795 Aug 23 '26

Bty how long will it take me to be pro at C?

2

u/knouqs Aug 26 '26

Well, you are starting out, right? I expect four years of proper study. A professional is someone who is paid for their work. Create something that someone will buy or get paid to fix something that is broken. Once you have broken that barrier, you are a professional.

Your next question should be when you will be an expert. That is different.

3

u/mc_pm Aug 23 '26

If C is your first language? 2028 minimum - assuming you have some natural talent for it and you spend at least an hour or two a day programming and practicing.

1

u/grimvian Aug 23 '26

Depends very much of how dedicated you are.

1

u/Paul_Pedant Aug 26 '26

"The Book" costs 70 bucks list price online. You can download a copy for free.

Normally I would respect copyright, and care about the authors getting some reward. But Brian is now 84, and Dennis has been dead for 15 years. I don't think they will miss the pittance paid by publishers.

I don't hold with the two or four years estimates to become competent with C. It is quite a small language, and the man pages for the libraries are good once you can handle the (terse) style. The example questions are deceptively simple, and worth some different approaches.

I had a two-week intensive C course in 1980, converting me from mainframe assembler, COBOL, and RPG2. Third week, I was porting Bell Labs Unix to a new graphics machine (Three Rivers Perq).

2

u/knouqs Aug 26 '26

If you read my comment in which I wrote four years, that's more like being a competent computer scientist. You are right, learning C shouldn't take that long. Fixing bugs once you know the language shouldn't take that long, certainly.