I have few questions about it, so any help would be appreaciated, I want to make some things clearer.
1. What is the difference between C++ and Dev-C++? We are programing in Dev-C++.
2. We started doing Variables, there are few new terms
- char [1 byte]
- short int [2 byte]
- int [4 byte]
- long int [4 byte]
Why do we use them? What does it matter if something has 2 bytes more / less?
Why cant I write everything in long int? Why cant I write everything in short int?
What is the difference between int and long int? Since they are both 4 bytes.
3. We have Signed and Unsigned stuff.
Signed = Pozitive and Negative values
Unsigned = Pozitive only values (including zero)
Now this is what I'm not 100% sure do I understand
char = 1 byte (8 bit) = (in decimal system) 2^8 = 256.
*Unsigned = 0 to 255 // = 256 (we must include zero, right?)
*Signed = 256 / 2 = 128;
Maximum Negative Value = -128
Maximum Positive Value = 127 // (once again we include zero) = 128 nubmers
Meaning Signed = -128 to 127 , right?
What about binary system here?
Is there easier way to calculate the Signed values? I just made this way, idk any other, I'm looking in my notebook and I'm trying to find logic, and I found this.
Same thing goes to Int
int = 4 byte (32 bit) = (in decimal system) 2^32 = 4 294 967 296.
*Unsigned = 0 to 4 294 967 295
*Signed = 4 294 967 296 / 2 = 2 147 483 648;
Maximum Negative Value = -2 147 483 648
Maximum Positive Value = 2 147 483 647 // (once again we include zero) = meaning -1
Meaning Signed = -2 147 483 648 to 2 147 483 647.
Right?
How do I know whats signed / unsigned value for binary numbers?
How can I calculate them?
Thank you very much, any help is appreciated!




