00:00Let us look at the data types and their sizes. In this version of C++, data types,
00:13yeah, create a project here, ready-made code is given, I'll remove the things.
00:23Using namespace std,
00:31here I will declare a variable, character type x, then cout, I'll use an operator that is sizeof
00:40for finding the size of a character type variable. Let us run and see what is the size of a character,
00:47yeah, size of a character is 1. I'll just modify this data type and make it as int.
00:57Let us see what is the size of an integer, size of an integer is 4 byte. As we were assuming
01:06that size of an integer is 2 bytes, that is 16 bit, actually it is easy for discussing
01:12the data types if we assume integer as 2 bytes. We can understand how sign bit works
01:17and complement, that is the reason I was taking integer as 2 bytes.
01:25Next, let us take a float data type and run it. Float is 4 bytes, long 8 bytes, double 8 bytes,
01:53and long double, yeah, this is 16 bytes. That's it. Let me show you few more things here,
02:06that is if I again go back to character type and let us see what is the range of character, cout,
02:13char, max, and let us give some space, and then char min. These are the constants available.
02:36I can use these constants directly to know the minimum and maximum values. I have taken max
02:42first, then minimum. Let us try, run and see what are the maximum and minimum values of a character.
02:48See, it is minus 128 to 127. I will try to change it to min and here I will make it as max.
02:58Let us run it again. This is minus 128 to 127.
03:03If I take it as unsigned char, then let us see what are the minimum and maximum range values.
03:22It will have just maximum value because as it is unsigned, the minimum value will be zero only.
03:26There is no constant available for minimum. Maximum value is 255. Let us run and see.
03:38This is the minimum value of integer data type. This is the maximum value in 4 bytes,
03:45that is 21, 47, 48, 36, and 48. This is up to 47.
03:50By using these things, you can know what are the data type sizes and their minimum and maximum values supported by your compiler.