i need to really learn C

so far i am getting along by stealing and modding already existing code

the arduino bug has really bitten hard though and with what i am doing do far i am forced to limit my projects to stuff that already exists and just evolving it slightly :frowning:

so i need to learn C from the ground up

so what do you guys use?

are there any good web pages or books you would recommend

cheers

well i have found any ground up C lit is going to be for full blown computers and really confuses the subject

embedded c books like to narrow that down but it is still above what arduino does in its user friendly functions

I had no problems jumping into it, but I have been using systems similar to this for quite a while now, from what I remember when I started tho was just not understanding anything, to almost instantly understanding everything

one can pretty much figure out the functions by reading them, but the syntax or structure of the code is what throws a ton of people off, but pay attention to where ; and () and {} and [] are being used and it should start to pop for you pretty easily while exploring sample codes

and try not to start off with advanced ones either, go back and look at the blinking led script and this time focus on the markup rather than whats being done, you should be able to see block like structures of code forming in their {} brackets

Here is a link to a Intro to C textbook from the University of Hawaii. I was a TA for this class a few years back. It is based upon developing in a UNIX environment but the basics are all there. It can be downloaded in PDF format.

http://ee.hawaii.edu/~tep/EE160/Book/book.html

feel free to ask if you have any questions.

I really like the bite-sized examples in Kelley & Pohl's "A Book on C" and the way they dissect and explain them, but they aren't really aimed at embedded.

Something I want to reccommend:

Don't concentrate too much on learning "a language"; concentrate on learning the concepts behind the language, which tend to remain the same for most high-level languages (lisp not included!):

  1. Variables
  2. Scope
  3. Looping
  4. Control
  5. Etc.

Also study up on both "event-driven" programming, recursion, and OOP (object-oriented programming) concepts.

At a certain point, if you pay attention to what you are doing, and stick with it long enough (constant learning, constant programming, over many years), you'll come to realize that regardless of the language, they all pretty much function the same (even lisp, in its own loveable way). Most high-level languages descend from 2-3 historical roots: COBOL, Fortran, and C (one could throw Pascal into that list as well). You won't find many recent COBOL variants, though (DBC was probably one of the last environments, used in business and vertical-market coding, mainly). But Fortran begat BASIC, and C begat so many follow on languages it isn't funny.

Ultimately, it all boils down to assembler and machine code, so don't neglect your education there, either (some would reccommend you start there, actually - but that is a difficult proposition on modern PCs, unless you stick with 16-bit coding; fortunately, you can learn on microcontrollers as well). If you are really interested, study the history of that as well (ENIAC was an interesting example of a Turing-complete machine that used base-10, coupled with a "wired" program; Babbages Analytical Engine was interesting in that it implemented a version of microcode using a pegged drum, operated on base-10 as well, plus it was Turing-complete before Turing was born - all that and Ada Lovelace managed to write working code without any hardware; talk about hacking!).

As you can obviously tell, I love computers and their history a little too much (but I really do find the field intimately and infinitely fascinating)...

:slight_smile:

Famous Last Words:

so far i am getting along by stealing and modding already existing code

Well one has to stand on sombodys sholder to make progress in life

David