1 00:00:00,800 --> 00:00:12,820 Halo to game you learn how to convert strings to numbers so tender is far from the resource section 2 00:00:14,750 --> 00:00:24,110 0 3 convert string to num zip and put it in your face and projects there and then unzip it 3 00:00:28,280 --> 00:00:31,080 and now you can give it a zip file. 4 00:00:34,460 --> 00:00:37,190 And open the file and inside it. 5 00:00:37,190 --> 00:00:51,240 Here we see a new program called convert string to NUM has an So let's open it and that is running first 6 00:00:51,540 --> 00:00:56,900 to study the behavior run and compile 7 00:00:59,840 --> 00:01:14,340 and now open your project for the income on from and then never get to use a tree so we'll copy this 8 00:01:15,190 --> 00:01:27,060 tree 10 see to frankly base the path and enter type Yeah. 9 00:01:27,750 --> 00:01:31,010 And if you see the ECF ha. 10 00:01:31,050 --> 00:01:33,420 So that is funny. 11 00:01:33,420 --> 00:01:37,630 PRESENTER Any ask you to enter a number. 12 00:01:38,360 --> 00:01:41,620 So in um in turn number they say to. 13 00:01:42,030 --> 00:01:43,280 Presenter. 14 00:01:43,950 --> 00:01:46,740 And he returns three. 15 00:01:46,830 --> 00:01:52,490 He ran again into an unknown number. 16 00:01:52,500 --> 00:01:54,750 Presenter and he returns. 17 00:01:54,800 --> 00:01:56,230 Seventy nine. 18 00:01:56,250 --> 00:01:58,320 So this programme takes. 19 00:01:58,710 --> 00:01:59,530 Uh no. 20 00:01:59,550 --> 00:02:08,540 We should enter Congo into a number and then increases it by 1. 21 00:02:08,580 --> 00:02:12,890 Remember that whatever you enter here is a string. 22 00:02:13,170 --> 00:02:20,520 And that's why you need to convert it into a number before you can perform any kind of dramatic operation 23 00:02:22,260 --> 00:02:25,960 so let's see how he's done. 24 00:02:27,840 --> 00:02:43,200 So include unnecessary lines for every program and gave me specify the size of the input maximum assisting 25 00:02:43,230 --> 00:02:44,570 base. 26 00:02:44,870 --> 00:02:53,640 And here we have the string to ask the user to enter a number and the output string in this format. 27 00:02:53,780 --> 00:03:03,730 However this time we have a different format specify a presentation D the essential integer number. 28 00:03:04,860 --> 00:03:21,810 So and digit which means Integer 0 number and then we have the usual variables for you Windows API functions. 29 00:03:21,970 --> 00:03:25,450 And here is our code stats. 30 00:03:25,660 --> 00:03:33,130 So this is a prince the message enter number. 31 00:03:34,160 --> 00:03:39,290 So he pushes the string to this day there are no name printed. 32 00:03:41,090 --> 00:03:45,850 So we get this problem into a number. 33 00:03:45,860 --> 00:03:47,470 After that he gets the handle. 34 00:03:48,940 --> 00:03:57,570 The input handler which is referring to the command line and using Rand is being used by the refile 35 00:03:57,610 --> 00:03:59,920 as usual in the previous lessons. 36 00:03:59,920 --> 00:04:01,510 We have seen this. 37 00:04:01,750 --> 00:04:04,540 So now you receive whatever you input. 38 00:04:04,780 --> 00:04:07,880 For example you leave with seven year. 39 00:04:07,890 --> 00:04:12,090 It starts in this year it puts. 40 00:04:12,360 --> 00:04:14,440 Interesting is the UK here. 41 00:04:14,640 --> 00:04:15,370 It's a variable 42 00:04:18,690 --> 00:04:22,890 next he converted into a number. 43 00:04:22,950 --> 00:04:32,550 So this is the new function call string to unsigned long long here means there being no long integer 44 00:04:33,510 --> 00:04:35,410 unsigned means return. 45 00:04:35,640 --> 00:04:44,120 Negative values but even though we were here with 18 values we can still enter negative numbers. 46 00:04:44,120 --> 00:04:47,650 He was to look straight. 47 00:04:48,470 --> 00:04:55,370 If I enter 85 here is to increase it by 1 and even negative for 48 00:04:58,230 --> 00:05:04,810 so this function string to say long times from the Microsoft. 49 00:05:05,190 --> 00:05:10,010 We should see runtime library so we included here. 50 00:05:10,020 --> 00:05:18,320 Since you were a struggling and if his barometer here is the base. 51 00:05:19,880 --> 00:05:29,240 So in this case we want to input you and convert is number the string into a base then based in number 52 00:05:30,650 --> 00:05:32,930 and find a living as 0. 53 00:05:32,930 --> 00:05:40,760 Now trying to unsigned long takes the input string which is the number you enter here. 54 00:05:40,820 --> 00:05:50,310 The string and in Congress in based in and the result is starting e x. 55 00:05:50,870 --> 00:05:57,480 So in the next line you get there is up here it's just the numeric value of the string. 56 00:05:57,560 --> 00:06:07,160 In this case Sony converted into a number Sony and then started a variable call number which you declare 57 00:06:07,590 --> 00:06:07,880 here 58 00:06:11,730 --> 00:06:17,370 under you start the number in this variable code number. 59 00:06:17,370 --> 00:06:20,940 You can now increase the number by 1. 60 00:06:21,030 --> 00:06:23,420 So this is an automatic operation. 61 00:06:23,550 --> 00:06:30,800 I see an increase means to add 1 to the value stored in this address. 62 00:06:30,960 --> 00:06:32,310 So this is how you increase it. 63 00:06:33,030 --> 00:06:41,040 So whatever number one ever starting here will not be incremented by 1 and the rest is the same as before. 64 00:06:41,850 --> 00:06:45,410 You now calling the print function to print the number. 65 00:06:47,040 --> 00:06:49,840 So the first perimeter of the print. 66 00:06:50,430 --> 00:06:53,830 Is the the string and you want to print. 67 00:06:54,750 --> 00:07:01,880 And the second parameter is a number that you want to insert inside the string. 68 00:07:01,880 --> 00:07:03,260 Oh here. 69 00:07:03,930 --> 00:07:13,680 Presentation the percentage dy is the second barometer which is a number. 70 00:07:14,000 --> 00:07:19,970 So now you come to the next line you see the process. 71 00:07:19,970 --> 00:07:22,490 So this is how the program works. 72 00:07:22,550 --> 00:07:31,020 So I do feel free to experiment with this to modify the POV on other kinds of calculation to getting 73 00:07:31,030 --> 00:07:35,830 a grasp of how the conversion of the string looks. 74 00:07:36,790 --> 00:07:38,200 So that's a modest lesson. 75 00:07:38,650 --> 00:07:39,040 Thank you. 76 00:07:39,040 --> 00:07:39,520 Highlighting.