Advanced-Cpp/C2/Constructor-And-Destructor/Khasi
From Script | Spoken-Tutorial
Time | Narration |
00:01 | Pdiang sngewbha ia phi sha ka spoken tutorial halor ki Constructors and Destructors ha ka C++. |
00:07 | Ha kane ka jinghikai, Ngin sa pule ia ki: |
00:09 | * Constructors |
00:10 | * Ki jait jong ki constructors |
00:12 | * Destructors. |
00:13 | Ngin leh ia kane da ka jingiarap jong ki katto katne ki nuksa. |
00:17 | Ban record ia kane ka jinghikai, Nga pyndonkam: |
00:20 | * Ubuntu Operating System version 11.10, |
00:23 | * g++ Compiler version 4.6.1 |
00:28 | To ngin sdang da ka jingpynithuh sha ka Constructor. |
00:31 | Ka constructor ka dei ka dkhot function . |
00:33 | Ka don ia ka juh ka kyrteng kum ka class name. |
00:37 | Constructors kim lah ban pynphai ia ki value. |
00:40 | Ia ka la khot hi automatic ha ka por ba thaw ia ka object. |
00:44 | Ki jait jong ki Constructors : |
00:46 | * Parameterized Constructors |
00:49 | * Copy Constructors bad |
00:50 | * Default Constructors. |
00:53 | To ngin iaid sha ki Destructors. |
00:56 | Ia ki Destructors la pyndonkam ban pynkhuid ia ka memory ba la dep ai. |
00:59 | La khot ia kine ha ka por ba pynpait ia ka object. |
01:02 | U destructor u khlem shim arguments bad u khlem don ia ka return types. |
01:07 | To ngin peit ia ka nuksa halor ki Constructors bad ki Destructors. |
01:11 | Nga la dep type lypa ia ka code ha ka editor, ngan plie ia ka. |
01:15 | Buh kynmaw ba ka filename jong ngi ka dei ka cons hyphen dest dot cpp. |
01:20 | Ha kane ka program, Ngin leh ia ka jingkheinlang jong artylli ki nombar da kaba pyndonkam da ka constructor. |
01:25 | Ai ngan batai ia ka code mynta. |
01:27 | Kane kadei ka header file jong ngi kum iostream. |
01:30 | Hangne ngi la pyndonkam std namespace. |
01:33 | Nangta ngi don ia ka class Addition. a bad b ki dei integer variables. |
01:38 | Kine ki dei ki dkhot private jong ka class Addition. |
01:42 | Hangne ngi don ia ka Public specifier. |
01:44 | Nangta ngi don ia u construtor Addition. |
01:47 | U constructor u don ia kajuh ka kyrteng kum ka kyrteng ka class. |
01:52 | Ngi la dep ai ar tylli ki arguments hangne. |
01:54 | Mynta ngi la dep thaw ia u Destructor. |
01:57 | Na bynta kane ngi pyndonkam ia ka tilde sign bud da ka kyrteng kidestructors. |
02:02 | Kane ka dei ka public function add. |
02:05 | Ka pynphai ia ka jingkhien lang jong a bad b. |
02:08 | Hangne, ngi ioh pyndonkam ia u constructor da kaba pyndonkam ia u scope resolution operator. |
02:12 | a bad b ki dei ki dkhot private. |
02:15 | ban ioh pyndonkam ia ki dkhot private, ngi pyndonkam x bad y. |
02:19 | Nangta ngi pyndonkam ia u destructor. |
02:21 | ha kane , ngi print "Memory Deallocation". |
02:25 | Kane kadei ka main function. Jong ngi. |
02:28 | Hangne, ngi thaw ia ka object obj jong class Addition. |
02:32 | nangta ngi ai ar arguments kum 3 bad 4. |
02:36 | 3 yn sa buh ha u x bad 4 yn sa buh ha u y. |
02:40 | Kane ka mut ba ka jingdon u a ka dei 3 bad ‘’'b'’’ ka dei 4. |
02:45 | U constructor ba don arguments la khot parameterized constructor. |
02:50 | Dei na kata ba une uwei u dei u prameterized constructor. |
02:53 | Hangne, ngi khot ia u function add da kaba pyndonkam ia ka obj. |
02:58 | bad ngi print ia ka jingkheinlang. |
03:00 | Kane ka dei ka return statement jong ngi. |
03:02 | Mynta to ngin execute ia ka program. |
03:05 | Plie ia ka terminal window da kaba nion Ctrl, Alt bad T keys ryngkatlang ha ka keyboard jong phi. |
03:12 | Ban compile, type: g++ space cons hyphen dest dot cpp space hyphen o space cons |
03:21 | Press Enter. |
03:23 | Type: dot slash cons |
03:25 | Nion Enter. |
03:27 | La pyni ia ka output kum: |
03:29 | Sum is 7 bad Memory Deallocation. |
03:33 | Mynta to ngin peit ia ka nuksa halor ka Default constructors. |
03:37 | Wanphai biang sha ka program jong ngi. |
03:39 | Nga la dep type lypa ia ka code. |
03:41 | Buh kynmaw ba ka kyrteng jong ka file jong ngi ka dei default dot cpp. |
03:45 | Lada ia u constructor la khlem pynbna ne declare ha ka class |
03:48 | nangta ka compiler kan shu thaw ia u default constructor na bynta ka class. |
03:53 | Ai ngan batai ia ka code. |
03:55 | Kane ka dei ka header file jong ngi kum iostream. |
03:58 | Hangne ngi la dep pyndonkam std namespace. |
04:02 | Nangta ngi don ia ka class Subtraction. |
04:04 | Nangta ngi don ia u a bad b ba la pynbna kum public. |
04:08 | Hangne, ngi don sub function. |
04:10 | Ngi la ai ar tylli ki arguments int a bad int b. |
04:15 | Kane ka pynphai ia ka jingshimnoh jong artylli ki number a bad b. |
04:19 | Kane ka dei ka default constructor. |
04:22 | Hangne, ngi ioh pyndonkam ia u default constructor da ka ba pyndonkam da u scope resolution operator. |
04:27 | Kane kadei ka main function jong ngi. |
04:29 | Ha kane, ngi la dep define ia u variable x. |
04:34 | Hangne ngi thaw ia ka object 's' jong ka class subtraction. |
04:39 | nangta ngi khot ia ka function sub da kaba pyndonkam da ka object s. |
04:42 | Bad ai ar tylli ki arguments Kum 8 bad 4. |
04:47 | Ia ka result la buh ha u variable x. |
04:51 | Bad hangne ngi print ia ka jingiapher. |
04:54 | Kane ka dei ka return statement jong ngi. |
04:56 | Mynta, to ngin execute ia ka program. |
04:58 | Wanphai biang sha ka terminal jong ngi. |
05:01 | To ngin compile, type: g++ space default dot cpp space hyphen o space def |
05:09 | Press Enter. |
05:10 | Type: dot slash def |
05:12 | Press Enter. |
05:14 | Ka output ka la wanphai kum: |
05:16 | Difference is 4. |
05:18 | Phai biang sha ka program jong ngi. |
05:20 | Hangne phi lah ban iohi ba ngi la ai ia ki arguments hapoh jong ka function. |
05:25 | Bad ha ka nuksa jong ngi ba hashwa kane, ngi la ai ia ki arguments hapoh jong ka Object. |
05:30 | Bad hangne ngi la dep ai ia ki arguments da kaba pyndonkam da ka Object. |
05:34 | Mynta, to ngin leit biang sha ki slides jong ngi. |
05:38 | To ngin ia batai lyngkot. Ha kane ka jinghikai ngi la pule shaphang ki: |
05:41 | * Constructor. eg, Addition |
05:43 | * Parameterized Constructor. eg. Addition obj (3, 4); |
05:48 | * Destructor. eg. ~Addition |
05:52 | * Default Constructor. eg. Subtraction |
05:55 | Kum ka assignment, thaw ia ka class ba kyrteng Division. |
05:59 | Thaw ia u constructor na bynta ka class. |
06:01 | Bad thaw ia ka function divide ba phiah ia ar tylli ki nombar ba la ai. |
06:06 | Peit ia ka video badon ha ka link ba pyni harum. |
06:09 | Ka batai lyngkot ia ka Spoken Tutorial project. |
06:11 | Lada phim don ia ka internet basted, phi lah ban download bad peit ia ka. |
06:16 | Ka Spoken Tutorial Project Team: ka pynlong ia ki workshop da ka ba pyndonkam da ki spoken tutorials.
. |
06:21 | Ai certificates ia kiba pass ha ka online test. |
06:25 | Na ka bynta jingtip ba khambniah, sngewbha thoh sha: |
06:27 | contact@spoken-tutorial.org |
06:31 | Spoken Tutorial Project ka dei ka bynta jong ka "Talk to a Teacher" project. |
06:36 | La kyrshan ia ka da ka National Mission on Education lyngba ICT, MHRD, Sorkar jong ka ri India. |
06:42 | Ki jingtip kiba kham bun halor kane ka mission lah ban ioh na kane ka link harum. |
06:47 | Nga dei u Thawlad miki bad la pynkylla ia kane ka script da I Arkijuh Dkhar, ngan pynkut noh..
Khublei ba phi la iashim bynta. |