C the compiler tool (and a little bit, C the language)


Below are links concerning usage of the C programming language. I am not interested in teaching you C as a language, but would like to familiarize you with the simplest basics of  C as a tool.

If you knew nothing whatsoever about Spanish I might want to familiarize you with its usage, but without teaching you Spanish itself. I'd like you to know that Spanish has something called "noun gender." And there are diacritical marks in written Spanish called "accents." What a concept! We have neither of those and you've never heard of them. I would tell you about the language's spelling and punctuation patterns. We would mention word order, omission of pronouns, and other things you didn't know. At the end, you would have a kind of structural understanding of the language. But you would not have vocabulary, idiom, and by no means command of the language. That's a whole different level of ambition. You would not speak Spanish yourself, but you would know how Spanish speakers do it.  I you want to actually speak Spanish, go take a Spanish class or two. Here, we just want to step your toe in the water.

That's what I want to do here, not with Spanish but with C. While I won't teach you how to program in C, I would like you to know how programmers who do that accomplish their work. How do they write their programs? After writing them, what must they do with them in order to get the computer to run them? What is involved in that? What happens to a program to change it from the form in which it was written to that in which it can run? I don't want you to know C, but I want you to know what it's like.

What does a compiler do?
Read this link for an overview

Obtaining a C compiler to use
Find out where to get your hands on a C compiler

Series of example programs
Each example program shows some feature of the language. Many of the features are common to other programming languages while others are specifically unique to this one. The successive examples build little by little on their predecessors. The programs are short enough that you can key them in, then compile and get them to run to see how they operate.


adding two numbers

user input

a user-defined function

a library function

a while loop

a squareroot function