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

Summary: Qualifiers

Keywords

Use the following keywords to qualify variables:

const, volatile, restrict

General Comments

A qualifier constrains a variable's use in some way. A const variable, after it's initialized, can't be altered. The compiler can't assume that a volatile variable hasn't been changed by some outside agency, such as a hardware update. A pointer qualified with restrict is understood to provide the only access (in a particular scope) to a block of memory.

Properties

Note

The declaration

const int joy = 101;

establishes that the value of joy is fixed at 101.

The declaration

volatile unsigned int incoming;

establishes that the value ...

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