Integer and unsigned integers are the answer.
Keep in mind that signal transmission is just an interpretation of bits, -1 or 1 is just a “print” serializer that interprets a “variable type” because it was "discovered" for the cout functions (operator overloading) by the compiler, the bit is the same, its value is also (on / off) - since you have only 1 bit.
Do not worry about this, but it is good practice to be explicit, so prefer to declare your variable unsigned, it instructs the compiler to set the correct code when you set or get a value for a serializer like "print" (cout).
"COUT" OVERLOADING THE OPERATOR: "cout" works through a series of functions that overloads the parameter with the instructions of the compiler that calls the function. Thus, there are two functions: one receives unsigned and the other signed, so they can interpret the same data in different ways, and you can change them by telling the compiler to call the other using a cast. See cout <MyClass
Luciano Jul 08 '15 at 15:34 2015-07-08 15:34
source share