C-and-Cpp/C2/Functions/Khasi
From Script | Spoken-Tutorial
Time | Narration |
00:01 | Ngi pdiang sngewbha ia phi sha ka Spoken Tutorial halor ka“Functions in C and C++ . |
00:06 | Ha kane ka jinghikai ngan batai shaphang, |
00:09 | kaei ka “function” |
00:11 | Syntax jong ka “function” |
00:13 | Jingdonkam jong ka “return statement” |
00:16 | Ngin leh lyngba kine ki nuksa. |
00:18 | Ngin peit ruh katto katne ki common errors bad ki solutions. |
00:22 | Ban record ia ka jingpule, Nga pyndonkam da, |
00:25 | Ubuntu Operating System version 11.10, |
00:29 | “gcc” bad “g++ compiler” version 4.6.1. |
00:35 | To ngin sdang da ka jinglamphrang jong ki “functions”. |
00:39 | Ka “function” ka dei ka self-contained program kaba pyndep ia ka kam ba lah ai. |
00:45 | Manla ka program ka kynthup ia kawei ne bun ki “functions.” |
00:49 | Haba lah pyndep shisien, ka control kan wanphai biang na kaba la access. |
00:55 | To ngin peit ia ka syntax jong ka “function.” |
00:59 | “trt-type” ka batai ia ka type jong ka data kata ka “function returns.” |
01:05 | '“fun_name” ka batai ia ka kyrteng jong ka function. |
01:09 | '“parameters” ka dei ka list jong ki “variable” kyrteng bad ki jait. |
01:14 | Ngi lah ban kdew ia ka “empty parameter list”. |
01:18 | Ia kane la khot ka “functions without arguments.” |
01:21 | Bad ia kane la khot “functions with arguments.” |
01:26 | To ngin peit ia ka program da kaba pyndonkam ka “void.” |
01:29 | Nga lah dep type ka program ha ka editor. |
01:32 | Te ngan plie iaka. |
01:35 | Kynmaw ba ka kyrteng jong ka phail kadei ka “function.” |
01:38 | Bad nga lah save ia ka phail lyngba ka extension “.c”(dot c). |
01:43 | To ngan batai ia u code. |
01:45 | Kane ka dei ka “header file” jong ngi. |
01:47 | Shuwa ban pyndonkam kano kano ka “function”, dei ban batai bniah. |
01:51 | Hangne ngi lah batai ba ka “function”la khot “add.” |
01:54 | Kynmaw ba ka “add function” kamdei kano kano ka “arguments.” |
01:58 | Bad ka return type ka dei ka “void.” |
02:01 | Don ar tylli kijait functions- |
02:03 | “User-defined” kaba dei ka “add function” jong ngi bad |
02:06 | “Pre-defined” kaba dei ka “printf” bad “main function”. |
02:12 | Hangne ngi lah initialized “a” bad “b” da kaba assign ia ki values kum 2 bad 3. |
02:19 | Hangne ngi lah declared ia u variable “c.” |
02:21 | Nangta ngi khein lang ia ki values jong u a bad b. |
02:24 | Ka result la thep ha ka c. |
02:27 | Nangta ngi print ia ka result. |
02:29 | Kane ka dei ka “main function” jong ngi |
02:32 | Hangne ngi leit biang sha ka “add”function. |
02:34 | Ka addition operation kanlong ban pyntreikam bad ka result yn print. |
02:39 | Mynta click “save.” |
02:42 | To ngin execute ia ka program. |
02:45 | Sngewbha plie ia ka terminal window da kaba nion “Ctrl, Alt” bad “T” keys ha ka juh ka por. |
02:53 | Ban compile, type “gcc function dot c hyphen o fun”. |
03:00 | Ban execute, type “./fun” (dot slash fun). |
03:05 | Ngi iohi ba ka output la pyni kum “Sum of a and b is 5”. |
03:10 | Mynta ngin phai biang sha ka program jong ngi. |
03:13 | Ki Functions ki don ki special identifiers ba khot kum ki “parameters” ne “arguments.” |
03:20 | To ngin peit da ki juh ki nuksa lyngba ki arguments. |
03:23 | Ngan pynkylla ia ki katto katne hangne. |
03:27 | Type “int add (int a, int b)” |
03:32 | Hangne ngi lah pynpaw ia ka “function add.” |
03:36 | '“int a” bad “int b” ki dei ki “arguments” jong ka function “add.” |
03:41 | To ngin pyndam noh ia kane. |
03:42 | Ym donkam ban initialize ia u a bad b hangne. |
03:46 | Pyndam ia ka “printf” statement. |
03:49 | Type “int main ()” |
03:52 | To ngin pynpaw ia u variable “sum” hangne. |
03:54 | Type “int sum;” |
03:57 | Nangta type “sum = add (5, 4);” |
04:03 | Hangne ngin leit biang sha ka “add function.” |
04:05 | Nangta ngin iaid sha ka prarameters kum 5 bad 4. |
04:10 | Yn buh ia u 5 ha “a” bad 4 yn buh ha “b.” |
04:14 | Ka addition operation la lah ban pyndep. |
04:18 | To ngin print ia ka result. |
04:20 | Namarkata type hangne |
04:21 | '“printf(“Sum is %d\n”, sum); |
04:27 | Pyndam ia kane, ha kaba ngi lah dep khot ia ka function halor. |
04:32 | Type “return0;” |
04:36 | U “non-void function” u dei ban pyndonkam ha ka “return” statement ka ba return ia u value. |
04:41 | Click “Save”. |
04:43 | To ngin execute ia ka program. |
04:45 | Phai biang sha ka terminal jongngi. |
04:48 | Mynta compile ia ka program kumba mynshuwa. |
04:50 | To ngin execute. |
04:52 | Ia Ka output la pyni kum “sum is 9”. |
04:57 | Mynta to ngin peit kumno ban execute ia ka juh ka program ha ka C++. |
05:02 | Phai biang sha ka program jong ngi. |
05:04 | To ngin pynkylla ia ki katto katne hangne. |
05:07 | Nyngkon nion “Shift, Ctrl bad S” keys ha kajuh ka por. |
05:12 | Mynta save ia ka phail ha ka “.cpp” extension. |
05:18 | Click “Save”. |
05:19 | Nyngkong eh ngin pynkylla ia ka header phail kum <iostream> |
05:24 | Ngin kynthup ia ka “using” statement hangne. |
05:28 | Ka “function declaration” ka long ka juh ha ka C++. |
05:32 | Te yn ym donkam ban pynkylla ei ei hangne. |
05:37 | Mynta buh pat ka “printf” statement da ka “cout” statement, kumba ngi pyndonkam ia ka cout<<function ban print ia ka lain ha ka C++. |
05:48 | Ngim donkam ia ka “format specifier” bad \n hangne. |
05:52 | Pyndam ka “comma.” |
05:54 | Mynta, type artylli ki opening “angle brackets”. |
05:58 | Hadien ka sum, sa shisien pat type artylli ki opening “angle brackets”. |
06:03 | Hapoh ki double quotes, type “backslash n”. |
06:07 | Pyndam noh ki closing bracket. |
06:09 | Mynta click “Save.” |
06:11 | To ngin compile ia ka program. |
06:14 | Phai biang sha ka terminal jongngi. |
06:16 | Type “g++ function dot cpp hyphen o fun1” |
06:23 | Hangne ngi don “fun1”, ka long namar ngim kwah ban overwrite ia ka output phail “fun”. |
06:31 | Nion “Enter.” |
06:34 | Type “./fun1” |
06:38 | Ka output kan pyni kum: sum is 9 |
06:42 | Mynta ngin peit ia ka common errors kaba ngi shait shem barabor. |
06:47 | Tharai hangne, ngi type x ha ka jaka jong u 4. |
06:51 | Ngan pynsah ia kiwei pat ki code kumba long. |
06:55 | Click “Save.” |
06:58 | To ngin compile ia ka program. |
07:02 | Ngi iohi ia ka error ha ka lain no. 10. |
07:06 | 'Ia u “x”khlem pynpaw ha ka scope”. |
07:09 | Kane ka long namar u “x” u dei u “character” variable. |
07:13 | Ka khlem pynpaw shano shano. |
07:15 | Bad ka “add” function jong ngi ka don u “integer” variable kum u “argument”. |
07:21 | Nangta, kan don ka jingbymiadei ha ka “return type” bad “return value”. |
07:25 | Mynta phai biang sha ka program jong ngi. |
07:27 | To ngin pynbeit ia ka error. |
07:30 | Type 4 ha ka lain no. 10. |
07:32 | Click “Save.” |
07:35 | To ngin execute sa shisien. |
07:37 | To ngin pyndam ia ka prompt. |
07:40 | Compile ia ka program kum mynshuwa. |
07:42 | Hoid! Ka la long. |
07:45 | Mynta ngin iohi sa ka wei ka common error kaba ngi shait shem. |
07:50 | Tharai hangne ngi iaid tang one parameter. |
07:55 | Pyndam u 4. |
07:56 | Click “Save”. |
07:58 | Switch sha ka terminal. |
08:00 | To ngin compile. |
08:01 | Ngin iohi ia ka error ha ka lain no. 10. |
08:06 | 'too few arguments to function ‘int add (int, int)’” |
08:11 | Switch biang sha ka program jong ngi. |
08:14 | Phin ioh hangnce ba ngi don artylli ki parameters |
08:19 | “int a” bad “int b.” |
08:22 | Bad hangne ngi iaid lyngba tang kawei ka parameter. |
08:25 | Namarkata ka sa ai ia ka error. |
08:27 | To ngin pynbeit ia ka error. |
08:29 | Type 4. |
08:31 | Click “Save”. |
08:34 | Switch sha ka terminal. |
08:36 | To ngin execute sa shisien. |
08:39 | Hoid! Ka la long. |
08:42 | Phai biang sha ki slides jongngi. |
08:44 | Ban iathuh lyngkot, ha kane ka jinghikai ngi lah tip- |
08:49 | “function” |
08:50 | Syntax of” function |
08:51 | “Function without arguments” |
08:53 | Eg- void add() |
08:55 | Function with arguments |
08:57 | Eg- Int add (int a, int b) |
09:02 | Kum ka assignment- |
09:03 | Thoh ia ka program ban calculate ia ka square jong u number. |
09:07 | Peit ia ka video ba la ai ha ryngkat ka link ha trai. |
09:11 | Ka batai lyngkot ia ka Spoken Tutorial Project. |
09:14 | Lada phim don ka bor internet ba khlain, shu download sa peit pat hadien. |
09:18 | Ka Spoken Tutorial Project Team |
09:21 | ka pynlong ki workshop da ba pyndonkam ia ki spoken tutorials. |
09:24 | Yn ai syrnod ia kiba pass ia ka online test. |
09:28 | Na bynta ka jingtip ba kham bniah, sngewbha thoh sha ka 'contact@spoken-tutorial.org |
09:35 | Spoken Tutorial Project ka dei ka bynta jong ka Talk to a Teacher. |
09:40 | La kyrshan ia kane ka project da ka National Mission on Education lyngba ICT, MHRD, jong ka sorkar India. |
09:47 | Shuh shuh ki jingtip halor kane ka mission phin ioh na kane ka link ba la ai harum : |
09:52 | La pynkylla sha ka ktien khasi da i Godwin pyrbot |
09:55 | Khublei naka bynta ba iasnohlang |