Part 23 – Boolean Variables

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/Reverse-Engineering-Tutorial

The next stage in our journey is that of Boolean variables. The name goes back to the great George Boole to which all modern computer science has derived. 

At the lowest level a value is either 0 or 1, false or true, + < 5 volts or +5 volts, etc.

Let’s examine our code.

#include <iostream>

 

int main(void) {

            bool isHacked = false;

 

            std::cout << isHacked << std::endl;

 

            return 0;

}

To compile this we simply type:

g++ example4.cpp -o example4

./example4

SUCCESS! We see 0 printed to the standard output or terminal!

Let’s break it down:

We create a boolean variable called isHacked to which we assign a value of false or 0. When we run the binary we clearly see the value 0 that successfully was echoed to the standard output.

Next week we will dive into Debugging Boolean Variables.

results matching ""

    No results matching ""