``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227``` ```1 00:00:00,000 --> 00:00:03,250 >> SPIKA 1: Hebu sasa kuandika mpango wao kweli kulinganisha na masharti mawili 2 00:00:03,250 --> 00:00:04,245 tabia kwa tabia. 3 00:00:04,245 --> 00:00:06,830 Hebu kutumia kulinganisha 0 kama yetu kuanzia. 4 00:00:06,830 --> 00:00:11,550 Lakini hebu peel ya kwanza ya nyuma safu kwamba ni ya aina kamba na kuandika upya ni 5 00:00:11,550 --> 00:00:14,120 kwa nini ni kweli ni, ambayo ni nyota char. 6 00:00:14,120 --> 00:00:17,740 Hiyo ni anwani ya tabia, hasa tabia ya kwanza katika 7 00:00:17,740 --> 00:00:21,010 mlolongo wa wahusika kwamba tunatarajia zaidi kwa ujumla kujua kama kamba. 8 00:00:21,010 --> 00:00:21,880 >> Same kwa t. 9 00:00:21,880 --> 00:00:25,660 Hebu kuandika upya kwamba kamba tamko kama char nyota. 10 00:00:25,660 --> 00:00:28,690 Na sasa tunahitaji tena kulinganisha dhidi ya t, ili 11 00:00:28,690 --> 00:00:30,150 sisi kulinganisha anwani mbili. 12 00:00:30,150 --> 00:00:33,180 Tunataka kweli kulinganisha masharti mawili wenyewe. 13 00:00:33,180 --> 00:00:37,520 Kwa kufanya hivyo, tunaweza kutumia kazi alitangaza katika string.h. 14 00:00:37,520 --> 00:00:40,920 Basi, mimi itabidi kuongeza kuwa ni pamoja na juu ya faili yangu. 15 00:00:40,920 --> 00:00:43,130 >> Na kisha mimi nina kwenda na mabadiliko ya line hii hapa. 16 00:00:43,130 --> 00:00:47,920 Badala ya kulinganisha dhidi ya t, mimi nina kwenda kuwaita kazi koroga Comp, 17 00:00:47,920 --> 00:00:52,290 kwa kamba kulinganisha, na kupita katika kama hoja s na t. 18 00:00:52,290 --> 00:00:56,480 Tutaweza kuahirisha kisha kwa kamba kulinganisha na kufikiri kama s na t kweli ni sawa 19 00:00:56,480 --> 00:00:59,870 na basi ni kufikiri jinsi ya kulinganisha yao tabia kwa tabia. 20 00:00:59,870 --> 00:01:02,410 >> Sasa, kulingana na nyaraka kwa kamba kulinganisha, ni kweli 21 00:01:02,410 --> 00:01:06,920 kwenda na kurudi 0 ikiwa masharti mawili alisema katika na s na t ni sawa. 22 00:01:06,920 --> 00:01:09,490 Ni kwenda na kurudi namba hasi kama s waje kabla ya t 23 00:01:09,490 --> 00:01:13,740 alphabetically au idadi chanya kama s waje baada ya t alphabetically. 24 00:01:13,740 --> 00:01:16,090 >> Lakini kwa sasa, sisi tu huduma kuhusu usawa. 25 00:01:16,090 --> 00:01:19,270 Hivyo mimi nina kwenda kupima tu kama thamani ya kurudi kamba kulinganisha, 26 00:01:19,270 --> 00:01:21,450 kupita katika s na t, ni sawa na 0. 27 00:01:21,450 --> 00:01:24,940 Na kama ni hivyo, mimi nina kwenda kudai kwamba masharti mawili ni sawa. 28 00:01:24,940 --> 00:01:26,820 >> Lakini mimi nina kwenda kufanya moja mabadiliko mengine pia. 29 00:01:26,820 --> 00:01:30,410 Ni zamu nje kamba kwamba kupata, kwa yake nyaraka, wakati mwingine kurudi 30 00:01:30,410 --> 00:01:34,320 null, mwangalizi thamani kwamba, kwa mujibu kupata masharti nyaraka, njia 31 00:01:34,320 --> 00:01:35,450 kitu mbaya kilichotokea. 32 00:01:35,450 --> 00:01:38,830 Kwa mfano, sisi mbio nje ya kumbukumbu au user kwa namna fulani hakuwa kushirikiana. 33 00:01:38,830 --> 00:01:41,080 >> Kamba kulinganisha, wakati huo huo, ni kidogo tete. 34 00:01:41,080 --> 00:01:44,730 Kama kupita null kwa aidha yake kwanza au hoja ya pili yake, mbaya 35 00:01:44,730 --> 00:01:45,650 mambo yanaweza kutokea. 36 00:01:45,650 --> 00:01:47,970 Mambo mabaya kwa kawaida kuwashirikisha segmentation makosa. 37 00:01:47,970 --> 00:01:52,210 Hivyo ili kuepuka uwezekano kwamba kabisa, Mimi kwanza kwenda kufuta hii matumizi ya 38 00:01:52,210 --> 00:01:56,350 kamba kulinganisha na indenting yote hii kuzuia wa kanuni na ya kwanza kufanya tu 39 00:01:56,350 --> 00:02:03,140 kwamba kama s si sawa na null na t si sawa na null. 40 00:02:03,140 --> 00:02:08,280 >> Kumalizika kwa mpango kwamba kama mwingine kujenga kwamba mimi typed mapema na braces curly kama 41 00:02:08,280 --> 00:02:12,270 vizuri, hivyo kwamba wakati huu mimi tu kugusa s na t kama mimi nina uhakika kwamba 42 00:02:12,270 --> 00:02:13,450 wao ni si null. 43 00:02:13,450 --> 00:02:17,220 Hebu sasa kuokoa, kukusanya, na tena kuendesha mpango huu. 44 00:02:17,220 --> 00:02:22,240 >> Kufanya kulinganisha 1 dot slash kulinganisha 1. 45 00:02:22,240 --> 00:02:23,950 Mimi itabidi kusema hello tena. 46 00:02:23,950 --> 00:02:25,890 Ikifuatiwa na hujambo tena. 47 00:02:25,890 --> 00:02:28,110 Na wakati huu, mimi kweli aina kitu kimoja. 48 00:02:28,110 --> 00:02:30,255 ```