Part 18 - Double Primitive Datatype

For a complete table of contents of all the lessons please click below as it will give you a brief of each lesson in addition to the topics it will cover. https://github.com/mytechnotalent/hacking\_c-\_arm64

Today we are going to talk about the C++ double datatype that stores double floating point values.

#include <iostream>

int main()
{
    double my_double = 10.1;

    std::cout << my_double << std::endl;

    return 0;
}

Very simply we create a float and assign a simple value to it and print it.

Let's compile and link.

g++ -o 0x06_double_primitive_datatype 0x05_double_primitive_datatype.cpp

Let's run.

./0x06_double_primitive_datatype

We simply see the following.

10.1

It successfully echoed 10.1 to the terminal stdout. Very simple.

Next week we will debug this very simple example.

results matching ""

    No results matching ""