I was reading this article : https://www.geeksforgeeks.org/cpp-modifier-types/
There it was mentioned that long int
is used to store large integer values, and I know the size of int
is 4 bytes. In the article, the size of long int
was 8 bytes, which made sense. But when I tried to use sizeof()
in Visual Studio, I got the size of both int
and long int
as 4.
Also, it was written in the article that long long
is used to store even larger integers, so I expected it to be 16 bytes, but both the article and Visual Studio say it's 8 bytes.
What is happening?
Also, why can char
be unsigned? I mean, according to the ASCII table, all characters are assigned non-negative numbers, so when will char
store negative numbers?