O'Reilly logo

Just Enough C/C++ Programming by Guy W. Lecky-Thompson

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

Declaring Variables

Chapter 2 introduced the concept of values stored in memory, with a global view of data types.

Recall that a variable is a named place where the program can store information, and that each place can store only one kind of information type. This is true for strongly typed languages—like C—where the compiler will complain when two types are not compatible.

In other words, square pegs cannot be put in round holes, but they can sometimes be persuaded to fit with some side effects. A small square peg will go into a large round hole, but there will always be a risk of it falling out and some superfluous space that serves no real purpose.

On the other hand, a large square peg will fit into a smaller round hole only if you are prepared ...

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