How to do it...

Perform the following steps to try this recipe:

  1. From a new Terminal, run the following command to download the source code:
> cd ~/
> git clone https://github.com/PacktPublishing/Advanced-CPP-CookBook.git
> cd Advanced-CPP-CookBook/chapter12
  1. To compile the source code, run the following command:
> cmake .
> make recipe02_examples
  1. Once the source code is compiled, you can execute each example in this recipe by running the following commands:
> ./recipe02_example01
i = int

> ./recipe02_example02
i = short int

> ./recipe02_example03
i = short int

> ./recipe02_example04
i1 = int
i2 = int

> ./recipe02_example05
i1 = int
i2 = const int
i3 = volatile int
i4 = const volatile int

> ./recipe02_example06
i1 = int
i2 = int&
i3 = int&&
a1 = int
a2 = int
a3 = int
a4 = int
a5 = int&
a6 = int&&
d1 = int
d2 = int&
d3 = int&&

In the next section, we will step through each of these examples and explain what each example program does and how it relates to the lessons being taught in this recipe.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset