Skip to content

Programming Prerequisites

For this lecture, we expect you to have a strong grasp of C programming and relevant experience. In particular, you should have experience of programming embedded systems using the C programming language and one of the available toolchains.

While knowledge of C++ is advantageous, this section will provide you with the necessary skills for programming codelabs and projects using C++ if you are unfamiliar with the language.

What are the main differences between C and C++

C++ is a direct descendant of C95 that offers several advantages. While C is a strictly procedural programming language, C++ supports different programming styles, C++ supporters therefore believe that it is impossible to write a program in C that expresses the programmer’s intentions more clearly than in C++.

The important advantages of C++ over C that are also important for embedded programming can be expressed as follows:

  • Wider range of programming styles.
  • Stronger type checking.
  • Better support for data abstraction.

Today’s compilers can also compile C++ code into executables that essentially provide the same runtime and memory footprint efficiency for the same task.

How to Experiment the Code Snippets

All of the code snippets provided in this chapter are available as a Zephyr RTOS application here. Cloning the repository at the root of your workspace enables you to build the different applications as standard Zephyr RTOS applications and run them on the selected target device.