Part 15 - Float 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++ float datatype that stores floating point values.

#include <iostream>

int main()
{
    float my_float = 10.1;

    std::cout << my_float << 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 0x05_float_primitive_datatype 0x05_float_primitive_datatype.cpp

Let's run.

./0x05_float_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 ""