O'Reilly logo

C Primer Plus, Fourth Edition by Stephen Prata

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

Section III—Basic Types and Storage Classes

Summary: The Basic Data Types

C's basic types fall into two categories: integers and floating-point numbers. The different varieties give you choices for range and precision.

Keywords

The basic data types are set up using the following eight keywords: int, long, short, unsigned, char, float, double, and signed (ANSI C).

Signed Integers

Signed integers can have positive or negative values.

int is the basic integer type for a given system.
long or long int can hold an integer at least as large as the largest int and possibly larger; long is at least 32 bits.
The largest short or short int integer is no larger than the largest int, and may be smaller. A short is at least 16 bits. Typically, long is bigger ...

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