Hey there,

I’m doing some mainlining stuff for Linux phones, so it’d be helpful for debugging to know C.

Sometimes I just have to figure out what a driver does that makes it fail, which is hard without really understanding the syntax.

So the question is: What are some good resources for learning C?

I mean, I roughly know what a variable or function is, as I’ve played with Arduinos before. I don’t need an explanation that covers what programming is, but I also don’t know enough to pogram an Arduino without googling the most basic syntax all the time.

I prefer guided stuff that makes me type and think over just reading specs as purely reading specs does not mean it’ll stay in the head.

  • EtherTide@aussie.zone
    link
    fedilink
    arrow-up
    9
    ·
    10 days ago

    The default answer to everyone who has ever asked this question (including me last year) is to read K&R C, the 2nd edition of the original book published by C’s inventor.

    I wouldn’t recommend powering from start to end like a normal book, I wouldn’t even recommend a hard copy, but it’s a comprehensive reference and the appendeces etc are good. I haven’t read much of it at all tbh but it’s nice to have. It’s still being sold but you can get it from a tonne of libraries etc. I got a pdf from a “friend”.

    Otherwise, I recommend watching and following along with Free Code Camp’s several hour C tutorial. Their editor of choice is so outdated I was’t able to install a working copy, but using JetBrains Clion or VS Code or Visual Studio etc etc are all good replacements.

    I’m still new to C so hopefully someone will come along who’s been doing it since the 1900’s.

    The Malloc and Nick Barker YouTube channels also have some excellent C videos that you might like.

  • crimsonpoodle@pawb.social
    link
    fedilink
    arrow-up
    3
    ·
    9 days ago

    The c programming language (first edition) such a perfect book. The second edition might be good too just haven’t read it. Its small enough to be a good reference.

  • who@feddit.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    9 days ago

    For books, I got more use from Harbison & Steele’s C: A Reference Manual than K&R. It has been a long time, though, so it’s possible that a great new book exists now.

    For online, I recommend bookmarking this site: https://cppreference.com/w/c.html