1
00:00:00,000 --> 00:00:00,560

2
00:00:00,560 --> 00:00:02,460
>> DAVID J. Malan: Hebu kuchukua mambo
hatua moja zaidi, sasa.

3
00:00:02,460 --> 00:00:05,450
Tuseme kwamba mimi si tu wanataka
magazeti yote ya mpango wangu

4
00:00:05,450 --> 00:00:06,630
hoja mstari amri.

5
00:00:06,630 --> 00:00:10,490
Lakini mimi badala yake, wanataka magazeti yote ya
wahusika binafsi katika kila moja ya

6
00:00:10,490 --> 00:00:14,060
mstari amri yangu hoja, moja kwa
line, ili juu ya mbio hii

7
00:00:14,060 --> 00:00:17,490
mpango, mimi tu kuona mkondo wa
wahusika juu ya screen kwamba

8
00:00:17,490 --> 00:00:20,700
pamoja ni kutoka mlolongo yangu
ya hoja mstari amri.

9
00:00:20,700 --> 00:00:21,980
>> Naam, jinsi gani naweza kufanya hili?

10
00:00:21,980 --> 00:00:26,540
Naweza kushika intact kitanzi yangu kutoka kabla ya
ambapo mimi usioisha kutoka i hadi

11
00:00:26,540 --> 00:00:30,060
Argc ili kuunganisha juu ya
hoja mstari amri wenyewe.

12
00:00:30,060 --> 00:00:34,460
Lakini sasa, ndani ya kila iteration ya kwamba
kitanzi, nahitaji sasa iterate juu ya kila

13
00:00:34,460 --> 00:00:38,550
ya wahusika au chars
katika kamba maalum.

14
00:00:38,550 --> 00:00:40,620
Hivyo kufanya hivyo, mimi haja moja zaidi kitanzi.

15
00:00:40,620 --> 00:00:42,090
>> Hebu kuongeza kwamba.

16
00:00:42,090 --> 00:00:46,890
kwa int, hebu simu yake j, sawa na 0.

17
00:00:46,890 --> 00:00:49,980
Sasa mimi nina kwenda haja ya kuunganisha
hadi urefu wa

18
00:00:49,980 --> 00:00:52,310
kamba sasa katika argv.

19
00:00:52,310 --> 00:00:55,910
Hivyo basi mimi kutoa mwenyewe mwingine mitaa
variable, tutaweza kuiita n, na kuweka

20
00:00:55,910 --> 00:01:00,120
sawa sawa kwa kamba urefu wa
sasa hoja, ambayo ni kwenda kuwa

21
00:01:00,120 --> 00:01:04,230
kupatikana katika argv bracket i semicolon.

22
00:01:04,230 --> 00:01:08,500
>> Hebu sasa iterate kutoka j up
mpaka n ikifuatiwa na

23
00:01:08,500 --> 00:01:10,400
nyongeza juu ya kila iteration.

24
00:01:10,400 --> 00:01:13,850
Hebu sasa magazeti ya mtu binafsi
wahusika juu ya screen.

25
00:01:13,850 --> 00:01:21,920
Printf% c wakati huu na kufuatiwa na mpya
line, karibu quote, comma, na sasa mimi

26
00:01:21,920 --> 00:01:25,565
haja tabia ya j-th
katika hoja i-th.

27
00:01:25,565 --> 00:01:30,240
>> Hivyo kupata wakati huo, siwezi tu
bayana bracket ARV i kwa

28
00:01:30,240 --> 00:01:32,050
kupata hoja i-th.

29
00:01:32,050 --> 00:01:36,140
Na kisha naweza kupiga mbizi katika ngazi moja zaidi
na kufanya index ya sekondari ya

30
00:01:36,140 --> 00:01:40,420
bracket j, mabano karibu,
semicolon, Hifadhi.

31
00:01:40,420 --> 00:01:43,610
Na hebu sasa kukusanya na
kuendesha mpango huu.

32
00:01:43,610 --> 00:01:46,630
>> Kufanya ARGV2 -

33
00:01:46,630 --> 00:01:48,440
si kabisa nini nilikuwa kutarajia.

34
00:01:48,440 --> 00:01:50,740
Hebu kitabu juu ya kwanza
ya ujumbe huu makosa.

35
00:01:50,740 --> 00:01:54,540
Na nyekundu hapa, tunaona makosa,
inamuunga kutangaza kazi maktaba

36
00:01:54,540 --> 00:01:56,290
strlen na aina -

37
00:01:56,290 --> 00:01:57,380
oh, kusubiri dakika.

38
00:01:57,380 --> 00:02:00,340
Hii ni mara ya kwanza nimepata kutumika
strlen, na mimi si wanatarajia

39
00:02:00,340 --> 00:02:04,970
kutaka ni mara ya kwanza, hivyo sikuwa ni pamoja na
header faili kwamba anatangaza

40
00:02:04,970 --> 00:02:06,290
kamba urefu kazi.

41
00:02:06,290 --> 00:02:09,419
>> Hivyo katika juu ya faili yangu,
kukumbuka, nina CS50.h.

42
00:02:09,419 --> 00:02:11,080
Mimi na kiwango io.h.

43
00:02:11,080 --> 00:02:14,500
Lakini ni zamu nje, na Mimi najua hili kutoka
kusoma nyaraka, kwamba mimi haja ya

44
00:02:14,500 --> 00:02:18,320
tatu header faili kama mimi, kwa kweli,
wanataka kutumia strlen kazi.

45
00:02:18,320 --> 00:02:22,760
Kazi ambayo ni alitangaza katika string.h.

46
00:02:22,760 --> 00:02:25,230
>> Hebu resave file,
kukusanya, na kukimbia.

47
00:02:25,230 --> 00:02:32,360

48
00:02:32,360 --> 00:02:35,570
Na wakati huu, sisi si tu
kuona kila hoja.

49
00:02:35,570 --> 00:02:40,470
Sisi badala yake kuona kila hoja
tabia ya moja kwa wakati mmoja.

50
00:02:40,470 --> 00:02:43,165