Skip to Content
21st Century C, 2nd Edition
book

21st Century C, 2nd Edition

by Ben Klemens
October 2014
Intermediate to advanced content levelIntermediate to advanced
408 pages
10h 19m
English
O'Reilly Media, Inc.
Book available
Content preview from 21st Century C, 2nd Edition

Appendix A. C 101

This appendix covers the basics of the language. It’s not for everyone.

  • If you already have experience writing code in a common scripting language, like Python, Ruby, or Visual Basic, this appendix will be at your level. I don’t have to explain to you what variables, functions, loops, or other basic building blocks are, so the main headings of this appendix are about the big differences between C and typical scripting languages.

  • If you learned C a long time ago and are feeling rusty, skimming this tutorial should remind you of the quirks that make C different and unique.

  • If you already work with C on a regular basis, don’t bother reading this appendix. You may also want to skip or skim the early parts of Part II as well, which are aimed at common errors and misunderstandings about the core of the language.

Don’t expect to be an expert in C by the end of this tutorial—there’s no substitute for real experience with the language. But you will be in a position to get started with Part II of this book and find out about the nuances and useful customs of the language.

The Structure

I’ll kick off the tutorial the way Kernighan & Ritchie did in their 1978 blockbuster book: with a program to say hello.

//tutorial/hello.c
#include <stdio.h>

int main(){
    printf("Hello, world.\n");
}

The double slashes on the first line indicate a comment that the compiler will ignore. All of the code samples in this appendix marked with a file name like this are available online ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical C

Practical C

Giulio Zambon
Smaller C

Smaller C

Marc Loy
C in a Nutshell, 2nd Edition

C in a Nutshell, 2nd Edition

Peter Prinz, Tony Crawford

Publisher Resources

ISBN: 9781491904428Errata Page