O'Reilly logo

Head First C by Dawn Griffiths, David Griffiths

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. C Topics: Revision roundup

image with no caption

Ever wished all those great C facts were in one place?

This is a roundup of all the C topics and principles we’ve covered in the book. Take a look at them, and see if you can remember them all. Each fact has the chapter it came from alongside it, so it’s easy for you to refer back if you need a reminder. You might even want to cut these pages out and tape them to your wall.

Basics

Chapter 1

Simple statements are commands.

Chapter 1

if statements run code if something is true.

Chapter 1

You can combine conditions together with && and ||.

Chapter 1

#include includes external code for things like input and output.

Chapter 1

Block statements are surrounded by { and }.

Chapter 1

switch statements efficiently check for multiple values of a variable.

Chapter 1

Every program needs a main function.

Chapter 1

Your source files should have a name ending in .c.

Chapter 1

You need to compile your C program before you run it.

Chapter 1

You can use the && operator on the command line to only run your program if it compiles.

Chapter 1

count++ means add 1 to count.

Chapter 1

while repeats code as long as a condition is true.

Chapter 1

for loops are a more compact way of writing loops.

Chapter 1

gcc is the most popular C compiler.

Chapter 1

-o specifies the output file.

Chapter 1

count-- means subtract 1 from count.

Chapter 1

do-while loops run code at least once.

Pointers and memory ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required