© Will Briggs 2021
W. BriggsC++20 for Lazy Programmershttps://doi.org/10.1007/978-1-4842-6306-8_3

3. Numbers

Will Briggs1  
(1)
Lynchburg, VA, USA
 

Numbers are what make the computer’s world go ‘round, so let’s examine ways to get the computer to handle those numbers for us.

Variables

Variables might seem like the letters we use in algebra – y = mx + b, that sort of thing – but in C++ they’re just places to store values. Example 3-1 shows what it looks like when we create variables.

(Final reminder: As with all numbered examples, you can find Example 3-1 in source code under the appropriate chapter – see Chapter 1’s section “Shapes and the functions that draw them” for how to find and run it.)
int main (int argc, char** argv)
{
    int seasonsOfAmericanIdol                   = ...

Get C++20 for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.