Difference between revisions of "C-and-C++/C4/Working-With-Structures/Bengali"
From Script | Spoken-Tutorial
(Created page with ' {| border=1 || ''Time''' || '''Narration''' |- | 00:01 | C এবং C ++ এ স্ট্রাকচারস এর কথ্য টিউটোরিয়ালে আ…') |
|||
Line 136: | Line 136: | ||
| 01:53 | | 01:53 | ||
| Here we have declared a '''structure '''as''' student'''. | | Here we have declared a '''structure '''as''' student'''. | ||
− | |||
|- | |- |
Revision as of 14:39, 12 September 2013
Time' | Narration
|
00:01 | C এবং C ++ এ স্ট্রাকচারস এর কথ্য টিউটোরিয়ালে আপনাদের স্বাগত। |
00:06 | এই টিউটোরিয়ালে আমরা শিখব, |
00:09 | স্ট্রাকচার কি? |
00:11 | স্ট্রাকচারের বিবৃতি। |
00:13 | আমরা এটি একটি উদাহরণের দ্বারা করব। |
00:16 | এই টিউটোরিয়ালটি রেকর্ড করতে আমি |
00:19 | উবুন্টু অপারেটিং সিস্টেম সংস্করণ 11.10 এবং |
00:23 | gcc এবং g ++ কম্পাইলার সংস্করণ 4.6.1 ব্যবহার করছি। |
00:29 | স্ট্রাকচারের ভূমিকা দিয়ে শুরু করা যাক। |
00:32 | যখন এক বা একাধিক ভ্যারিয়েবল এক নামের নিচে শ্রেণীবদ্ধ থাকে তখন তাকে স্ট্রাকচার বলা হয়। |
00:38 | স্ট্রাকচার এক বস্তুতে ভিন্ন তথ্য শ্রেণীভুক্ত করতে ব্যবহৃত হয়েছে। |
00:43 | একে কম্পাউন্ড ডেটা-টাইপ বলা হয়। |
00:45 | এটি সম্পর্কিত তথ্য শ্রেণীভুক্ত করতে ব্যবহৃত হয়েছে। |
00:49 | এখন আমরা দেখব |
00:50 | স্ট্রাকচার ঘোষণা করতে সিনটেক্স। |
00:53 | এখানে struct কম্পাইলারকে বলে যে স্ট্রাকচার ঘোষিত হয়েছে। |
00:59 | struct name হল স্ট্রাকচারের নাম। |
01:03 | উদাহরণস্বরূপ struct employee; |
01:05 | আপনি যে কোনো নাম দিতে পারেন। |
01:07 | এখন আমরা একটি স্ট্রাকচার ভ্যারিয়েবল ঘোষিত করা দেখব। |
01:12 | এর জন্য সিনটেক্স হল |
01:14 | struct struct_name and struct_var; |
01:17 | struct var হল struct name এর মত ভ্যারিয়েবল। |
01:22 | eg. struct employee addr; |
01:27 | addr is the variable of type employee. |
01:31 | Let us move on to our example |
01:33 | I have already typed the program on the editor |
01:36 | So let me open it. |
01:38 | Note that our filename is structure.c |
01:42 | In this program we will calculate the total marks of three subjects using structure |
01:49 | Let me explain the code now. |
01:51 | This is our header file. |
01:53 | Here we have declared a structure as student. |
01:57 | Then we have declared three integer variables as english, maths and science. |
02:04 | Variables defined under the structure are called as members of the structure. |
02:10 | This is our main function |
02:12 | Here we have declared an integer variable total. |
02:17 | Now we have declared a structure variable stud. stud is the variable of type student,it is used to access and modify the structure members |
02:30 | Here we have modified the members |
02:32 | By assigning them values as 75, 70 and 65. |
02:38 | Here we calculate the total of three subjects. |
02:42 | Then we print the result. |
02:44 | This is our return statement. |
02:47 | Now click on Save |
02:49 | Let us execute the program |
02:51 | Please open the terminal window by pressing |
02:54 | Ctrl, Alt and T keys simultaneously on your keyboard. |
03:00 | To compile |
03:01 | Type; gcc space structure.c space -o space struct |
03:10 | And press Enter |
03:12 | To execute |
03:13 | Type./struct Press Enter |
03:18 | The output is displayed as: Total is 210 |
03:22 | Now we will execute the same program in C++ |
03:26 | Come back to our program. |
03:28 | I will edit the same code |
03:31 | First press shift, cntrl and S keys simultaneously on the keyboard |
03:37 | Now save the file with an extension .cpp and click on save |
03:44 | Let us change the header file as iostream |
03:48 | Now include the using statement and click on save |
03:57 | Structure declaration in C++ is same as in C |
04:02 | So no need to change anything here |
04:05 | At the end we will replace the printf statement with the cout statement. |
04:08 | Delete the format specifier and \n |
04:16 | Now delete the comma |
04:17 | Type two opening angle brackets. |
04:21 | Here delete the closing bracket |
04:23 | and type two opening angle backets |
04:25 | And within the double quotes type \n |
04:29 | Now click on Save |
04:31 | Let us execute the program |
04:33 | Come back to our terminal |
04:35 | To compile type g++ space structure.cpp space -o space struct1 |
04:47 | Here we have struct1 because we dont want to overwrite the output parameters for the file structure.c |
04:55 | Now press Enter |
04:57 | To execute type ./struct1 |
05:02 | Press Enter |
05:04 | The output is displayed as: Total is 210 |
05:08 | You can see that the output is same as our C code |
05:12 | Now let us go back to our slides. |
05:15 | We will summarize now. In this tutorial we learned, |
05:18 | Structure. |
05:19 | Syntax of a structure. |
05:21 | eg. struct struct_name; |
05:24 | To access members of a structure. |
05:26 | Eg: stud.maths = 75; |
05:30 | To add the structure variables. |
05:33 | Eg: total = stud.eng + stud.maths + stud.science; |
05:40 | As an assignment, |
05:41 | Write a program to diplay the records of an employee. |
05:45 | Like name, address, designation, salary. |
05:49 | Watch the video available at the link shown below |
05:53 | It summarises the Spoken Tutorial project |
05:55 | If you do not have good bandwidth, you can download and watch it |
06:00 | The Spoken Tutorial Project Team |
06:02 | Conducts workshops using spoken tutorials |
06:05 | Gives certificates to those who pass an online test |
06:08 | For more details, please write to contact@spoken-tutorial.org |
06:15 | Spoken Tutorial Project is a part of the Talk to a Teacher project |
06:19 | It is supported by the National Mission on Education through ICT, MHRD, Government of India |
06:26 | More information on this Mission is available at: http://spoken-tutorial.org\NMEICT-Intro |
06:30 | This is Ashwini Patil from IIT Bombay. Siginning off. |
06:33 | Thank You for joining |