3 months ago

Learn C Essentials

Learn to program with the world’s most popular language using your Raspberry Pi





The C programming language been used to program everything from the tiny microcontrollers used in watches and toasters up to huge software systems – most of Linux (and Raspbian itself) is written in it. Learn to code with C on your Raspberry Pi across 13 packed chapters:

  • Create variables & do arithmetic
  • Control the flow of your C programs
  • For loops and case statements
  • Understand and create functions
  • Work with arrays and strings
  • Interpreting user input
  • and much more







Apologies for the following errata in Learn to Code with C. If you spot any errors in our books or magazines please email  us via errata@raspberrypi.orgThis list also appears on the Raspberry Pi forum.

On page 28, the code block contains the line int a = 5; 

This should be:

int a = 0;

On page 61 of the book, the use of the * as an argument to the program is mangled by the shell on Unix (although it does work correctly on Windows). To fix this for Unix, replace the line:

if (*argv[2] == '*') printf ("%d\n", arg1 * arg2);


if (*argv[2] == 'x') printf ("%d\n", arg1 * arg2);

and use ‘x’ rather than ‘*’ for multiplication.

On page 64, the code block contains the line for (value = 30; value < 40; value++) 

 This should be 

for (value = 48; value < 58; value++)

In the paragraph following this code block, the description “writing the bytes 30, 3…39“” should be “writing the bytes 48, 49…57“.

Want a new Pi Zero? Check out our latest subs offer!

Want a new Pi Zero? Check out our latest subs offer!

Learn to Code with C is freely licensed under Creative Commons (BY-SA-NC 3.0).

You can download this eBook free now and forever, but buying in print or digital supports the Raspberry Pi Foundation’s charitable mission.