O'Reilly logo

C by Nikolaos D. Tselikas, George S. Tselikis

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

Chapter 2

Data Types, Variables, and Data Output

In order to be able to write programs that actually perform useful tasks that save us time and work, this chapter will teach you how to use data types and variables. We’ll also go into more detail on the most important function for outputting data: the printf() function.

Variables

The computer’s RAM (random access memory) consists of millions of successive storage cells. The size of each cell is one byte. For example, an old PC with 16 MB (megabytes) of RAM consists of 16 × 1024 kB (kilobytes), or 16.777.216 memory cells. A newer PC with say 8 GB (gigabytes) of RAM would have 8 × 1024 MB = 8192 × 1024 kB = 8.388.608 × 1.024 = 8.589.934.592 memory cells.

A variable in C is a storage location with ...

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