1 00:00:00,880 --> 00:00:06,790 C++ supports jumps and in most cases there are better ways to branch code. 2 00:00:06,820 --> 00:00:10,780 However, for completeness, we will cover the mechanism here. 3 00:00:10,810 --> 00:00:18,010 There are two parts to a jump, a labeled statement to jump and the to go to statement. 4 00:00:18,040 --> 00:00:25,150 A label has the same naming rules as a variable and its declared suffixed with the column and it must 5 00:00:25,150 --> 00:00:27,130 be before statement here. 6 00:00:27,160 --> 00:00:30,460 The go to statement is called using the labels name here. 7 00:00:31,000 --> 00:00:34,570 Let's make it another follow up here for integer. 8 00:00:36,340 --> 00:00:41,500 Four integer zero while is less than ten. 9 00:00:43,260 --> 00:00:56,970 For integer zero, while E is less than ten and increment E by one here and std std C out or make it 10 00:00:56,970 --> 00:01:01,650 clear c of e here and end line here. 11 00:01:02,160 --> 00:01:11,070 And if E equals five, then go to RN here and. 12 00:01:12,490 --> 00:01:20,170 Actually, we don't need we have to declare the end here as well, if we make it go through here and 13 00:01:20,170 --> 00:01:20,860 here. 14 00:01:23,540 --> 00:01:26,180 Outside the loop here in the main function. 15 00:01:26,590 --> 00:01:27,390 And. 16 00:01:27,790 --> 00:01:28,370 And. 17 00:01:28,460 --> 00:01:29,390 STD. 18 00:01:29,600 --> 00:01:30,560 STD. 19 00:01:34,070 --> 00:01:35,840 Arrested or killed. 20 00:01:37,370 --> 00:01:38,570 And here. 21 00:01:43,320 --> 00:01:47,610 So the label must be in the same function as the column go through here. 22 00:01:47,820 --> 00:01:51,140 So let's make it run. 23 00:01:51,150 --> 00:02:01,230 And as you can see here, if condition is executed and we made it with go keyboard and executed the 24 00:02:01,230 --> 00:02:02,070 end here. 25 00:02:02,160 --> 00:02:05,040 So the label must be in the same function as the calling. 26 00:02:05,400 --> 00:02:07,290 Go through here, as I said earlier. 27 00:02:07,410 --> 00:02:13,440 But the jumps are rarely used because they encourage you to write non structured code. 28 00:02:13,470 --> 00:02:18,870 However, if you have a routine with the Halloween as a loops or if statements, it might make more 29 00:02:18,870 --> 00:02:25,170 sense and more readable to use a go to to jump to clean up code here.