1 00:00:01,380 --> 00:00:10,160 Each type will have a literal representation, so an integer will be numeric represented without the 2 00:00:10,170 --> 00:00:13,830 decimal point if it is assigned integer. 3 00:00:13,860 --> 00:00:19,650 The literal can also use the plus or minus symbol to indicate the sign. 4 00:00:19,680 --> 00:00:26,760 Similarly, a real number can have a literal value that contains a decimal point, and you may even 5 00:00:26,760 --> 00:00:30,300 use the scientific format, including an exponent. 6 00:00:30,300 --> 00:00:36,240 So C++ has a various rules to use when specifying literals in code. 7 00:00:36,810 --> 00:00:39,240 And these will be covered in next lecture, of course. 8 00:00:39,240 --> 00:00:42,380 So some examples in literals I will show you here. 9 00:00:42,390 --> 00:00:44,880 For example, let's create an integer named. 10 00:00:45,950 --> 00:00:49,190 And a poke here plus one. 11 00:00:49,970 --> 00:00:53,390 And then integer knock. 12 00:00:53,420 --> 00:01:05,150 Here's your here minus one and the double here, micro here, one E, six here. 13 00:01:05,390 --> 00:01:09,830 And double double unit here. 14 00:01:09,860 --> 00:01:12,070 Double unit here. 15 00:01:12,080 --> 00:01:13,510 One point here. 16 00:01:13,550 --> 00:01:20,570 Just a one point and steady string name here, for example, Oxo. 17 00:01:21,980 --> 00:01:28,700 And note that the unit variable, the compiler knows that the literal is a real number because the value 18 00:01:28,700 --> 00:01:29,870 has a decimal point. 19 00:01:29,870 --> 00:01:36,710 So for integers you can provide a hexadecimal literal in your code by prefacing the number with zero 20 00:01:36,740 --> 00:01:50,300 x here for example, integer the integer my x here zero x 100 zero x 100 here. 21 00:01:51,260 --> 00:01:57,680 So this is 256 in in decimal. 22 00:01:59,650 --> 00:02:00,570 The simple. 23 00:02:00,580 --> 00:02:02,500 Let's see what zero x? 24 00:02:04,070 --> 00:02:05,870 Means here, Plaintiff. 25 00:02:06,640 --> 00:02:08,340 A decimal. 26 00:02:08,380 --> 00:02:09,660 So decimal point. 27 00:02:09,660 --> 00:02:11,550 And my ex. 28 00:02:11,760 --> 00:02:17,710 Let's see as you can see here, zero X or 100. 29 00:02:17,730 --> 00:02:21,470 So here's the hexadecimal number type. 30 00:02:21,480 --> 00:02:30,660 And when you print this with the decimal format specified, you will get 256 integer by integer here. 31 00:02:30,660 --> 00:02:31,300 So. 32 00:02:31,330 --> 00:02:33,940 So these these are the integers of as well. 33 00:02:33,960 --> 00:02:37,470 Of course, this is a different numbering system. 34 00:02:37,650 --> 00:02:38,640 So. 35 00:02:39,990 --> 00:02:45,780 But by default the outward stream will print and the market values in base 11 as shown here. 36 00:02:45,810 --> 00:02:53,010 So however, you can insert a manipulator into an output stream to tell it to use a different number 37 00:02:53,010 --> 00:02:53,460 base. 38 00:02:53,460 --> 00:03:03,510 So the different the default behavior is here, steady this here deck here, which means the numbers 39 00:03:03,600 --> 00:03:11,580 should be displayed as base ten and std std octal. 40 00:03:11,580 --> 00:03:21,390 So it's the octal means that display as a octal base base eight and this is decimal. 41 00:03:21,510 --> 00:03:24,140 Decimal base ten. 42 00:03:24,150 --> 00:03:25,380 Let's write it here. 43 00:03:25,440 --> 00:03:28,380 Octal base eight. 44 00:03:29,620 --> 00:03:31,030 And so. 45 00:03:33,670 --> 00:03:35,730 What's next here? 46 00:03:35,740 --> 00:03:37,830 So we got the best 16 as well. 47 00:03:37,990 --> 00:03:38,770 So I'm sorry. 48 00:03:39,640 --> 00:03:43,470 I see the hex here based 16. 49 00:03:43,480 --> 00:03:54,250 So this means this play as a hexadecimal here, which is hexadecimal decimal base 16. 50 00:03:54,850 --> 00:03:57,520 Let's see here. 51 00:03:58,860 --> 00:03:59,220 Yes. 52 00:04:00,480 --> 00:04:05,970 And if you prefer to see the perfect that check your check. 53 00:04:05,970 --> 00:04:11,970 They use the three manipulator as the show base as shown here. 54 00:04:12,150 --> 00:04:15,180 See the show based show base here. 55 00:04:15,570 --> 00:04:16,130 Like this. 56 00:04:16,140 --> 00:04:19,100 So C++ defines some literals. 57 00:04:19,110 --> 00:04:24,700 So for bool, the logic type, there are true and false constants here. 58 00:04:24,720 --> 00:04:30,810 Let's make this comment because we will not write any codes on it for now. 59 00:04:31,620 --> 00:04:36,000 So as you know, logic type is a true or false. 60 00:04:36,120 --> 00:04:39,380 So where false is zero and true is one. 61 00:04:39,390 --> 00:04:41,760 So there is also no PR constant. 62 00:04:41,760 --> 00:04:47,160 Again, zero, which is used as invalid value for any pointer type.