C-and-C++/C3/Arrays/Gujarati

From Script | Spoken-Tutorial
Revision as of 11:55, 1 April 2014 by Jyotisolanki (Talk | contribs)

Jump to: navigation, search
Time Narration


00.01 Arrays in C and C++. પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે.
00.07 આ ટ્યુટોરીયલમાં આપણે શીખીશું, ,
00.09 array.શું છે.
00.11 array. નું ડીકલેરેશન શું છે.
00.13 Initialization of an array. નું ઇનીશલાઈઝેશન
00.16 પર કેટલાક ઉદાહરણો
00.18 આપણે અમુક સામાન્ય એરરો અને તેમનાં ઉપાયો પણ જોઈશું.
00.22 આ ટ્યુટોરીયલને રેકોર્ડ કરવા માટે, હું વાપરી રહ્યી છું
00.25 ઉબુન્ટુ ઓપરેટીંગ સીસ્ટમ આવૃત્તિ 11.04.
00.30 gcc અને g++ કમ્પાઈલર આવૃત્તિ 4.6.1.


00.36 ચાલો Arrayના પરીચય સાથે શરૂઆત કરીએ.
00.39 Array એ ડેટા અથવા કે સમાન ડેટા-પ્રકાર એલીમેન્ટ્સનું એક કલેક્શન છે.
00.44 Array ઇન્ડેક્ક્ષ 0 થી શરુ થાય છે.
00.48 પ્રથમ એલિમેન્ટ ઇન્ડેક્ક્ષ 0 પર સંગ્રહિત થાય છે.
00.52 arraysત્રણ પ્રકારના છે.
00.55 Single dimensional array.
00.57 Two dimensional array અને
00.59 Multi-dimensional array.
01.01 આ ટ્યુટોરીયલમાં આપણે 'single dimensional array ની ચર્ચા કરીશું.
01.06 ચાલો જોઈએ 'single dimensional array ને કેવી રીતે ડીકલેર કરવું.
01.09 આ માટેનું સિન્ટેક્સ છે.
01.11 data-type name of the array and size
01.16 ઉદાહરણ,અહી આપણે એક ઈંટીજર અરે સ્ટારને ડીકલેર કર્યું છે જે 5 એલિમેન્ટ ધરાવે છે.
01.24 Array ઇન્ડેક્ક્ષ star 0 થી star 4સુધી શુરુઆત થશે.
01.29 આપણે અરેનું ડીકલેરેશન જોયું


01.32 હવે આપણે અરેનું ઇનીશલાઈઝ જોશું.
01.35 આ માટેનું સિન્ટેક્સ છે.
01.38 data-type,( name of the array ), size is equal to elements


01.44 ઉદાહરણ,અહી આપણે એ ઈંટીજર અરે સ્ટાર માપ 3 સહીત ડીકલેર કર્યો છે.અરે ના એલિમેન્ટ 1 , 2 અને 3 છે
01.54 'અહી ઇન્ડેક્ક્ષ star 0 થી શરુ થઈનેstar 2સુધી છે.
01.59 હવે ચાલો ઉદાહરણો તરફે જઈએ
02.01 મેં એડીટર પર પહેલેથી જ પ્રોગ્રામ ટાઈપ કર્યો છે.
02.04 તો ચાલો હું તે ખોલું.
02.06 નોંધ લો આપણી ફાઈલ નું નામ array.c છે.


02.10 આ પ્રોગ્રામ માં આપણે અરેમાં સંગ્રહિત થયેલ એલીમેન્ટોનો યોગ ગણતરી કરીશું.
02.16 નોવ ચાલો હું કોડ સમજાવુ.
02.18 આ આપણી હેડર ફાઈલ છે.


02.20 આ આપણું મુખ્ય ફંક્શન છે


02.22 અહી આપણે અરે સ્ટારને માપ 3 સહિત જાહેર અને ઇનીશલાઈઝ કર્યું છે.
02.28 અરેના એલીમેન્ટો 4, 5 અને 6 છે.
02.33 ત્યાર બાદ આપણે integer variable sumને જાહેર કર્યું છે.
02.36 અહી આપણે અરેના એલીમેન્ટોને ઉમેરીએ છીએ અને sumમાં સંગ્રહિત કરીએ છે.
02.41 નોંધ લો કે 4 એ ઇન્ડેક્ક્ષ 0 પર સંગ્રહિત થશે,5 એ ઇન્ડેક્ક્ષ 1 પર સંગ્રહિત થશે અને 6 એ ઇન્ડેક્ક્ષ 2 પર સંગ્રહિત થશે.
02.50 ત્યાર બાદ આપણે sumને પ્રિન્ટ કરીએ છે.
02.52 આ આપણું return statement.છે.
02.54 હવે Saveપર ક્લિક કરો.
02.57 ચાલો પ્રોગ્રામ એક્ઝેક્યુટ કરીએ.
02.59 તમારા કીબોર્ડ પર Ctrl, Alt અને T કી એકસાથે દાબીને, ટર્મીનલ વિન્ડો ખોલો.
03.09 કમ્પાઈલ કરવા માટે ટાઈપ કરો, gcc space array dot c space hypen o array અને એન્ટર દબાવો.
03.19 એક્ઝેક્યુટ કરવા માટે ટાઈપ કરો, dot slash array એન્ટર દબાવો.
03.24 અહી આઉટપુટ આપેલ રીતે દેખાય છે
03.26 The sum is 15.
03.28 ચાલો હવે ઔમ્ક સમાન્ય એરરો જોઈએ જે સાથે આપણે રૂબરૂ થઈ શકીએ છીએ


03.32 પ્રોગ્રામ પર પાછા આવીએ
03.34 ધારો કે અહી લાઈન નંબર 4 પર આપણે છગડીયા કૌંસ ભૂલીએ છે.
03.39 Saveપર ક્લિક કરો . ચાલો જોઈએ શું થાય છે.
03.42 ટર્મિનલ પર પાછા આવો.
03.44 ચાલો પહેલાની જેમ જ કમ્પાઈલ કરીએ
03.47 આપણને એરર દેખાય છે.
03.49 Invalid initializer and Expected identifier or bracket before numeric constant.
03.56 કારણકે અરે છગડીયા કૌંસ અંતર્ગત ઇનીશલાઈઝ થવું જોઈએ.
04.01 આપણા પ્રોગ્રામ પર પાછા આવીએ.ચાલો એરર સુધારીએ.
04.04 અહીં લાઇન નંબર 4 પર છગડીયા ટાઈપ કરો
04.09 Saveપર ક્લીક કરો.
04.12 ચાલો એક્ઝેક્યુટ કરીએ. ટર્મિનલ પર પાછા આવો.
04.15 ચાલો પહેલાની જેમ કમ્પાઈલ કરીએ. ચાલો પહેલાની જેમ કમ્પાઈલ કરીએ.
04.19 હા આ કામ કરી રહ્યું છે.
04.21 હવે આપણે સમાન પ્રોગામC++એક્ઝેક્યુટ કરીશું.
04.25 આપણા પ્રોગ્રામ પર પાછા આવીએ .
04.28 હું અહી અમુક વસ્તુઓ બદલીશ.
04.30 પ્રથમ તમારા કીબોર્ડ પર Shift , Ctrl અને S keys એક સાથે દબાવો
04.38 હવે ફાઈલને dot cppએક્સટેન્શન સાથે સંગ્રહિત કરો અને Saveપર ક્લિક કરો.
04.44 ચાલો header file'ને iostreamતરીકે બદલીએ.
04.49

હવે using સ્ટેટમેન્ટનો સમાવેશ કરો.

04.55 C++'મા અરેનું ડીકલેરેશન અને ઇનીશલાઈઝેશન સમાન છે.
05.01 તેથી અહી કઈ પણ બદલવાની જરૂર નથી.
05.04 હવે printfસ્ટેટમેન્ટને cout સ્ટેટમેન્ટથી બદલો.
05.09 Delete the format specifier and back slash n, now delete the comma and type two opening angle brackets
05.17 Delete the bracket here. Again type two opening angle brackets and within the double quotes type back slash n
05.26 Now click on Save.
05.29 Let us execute. Come back to a terminal.
05.32 To compile type, g++ space array dot cpp space hypen o space array1.
05.42 Here we have array1 because we dont want to overwrite the output parameter array for the file array dot c
05.51 Now press Enter.
05.54 To execute type, dot slash array1 .Press Enter
05.59 The output is displayed as, The sum is 15
06.02 We can see that it is similar to our C code
06.07 Now, we will see another common error.


06.10 Come back to our program
06.12 Suppose here, at line number 7
06.14 I will type star[1], star[2] and star[3];
06.23 Click on Save.
06.24 Let us execute. Come back to our terminal
06.28 Let me clear the prompt.
06.30 Let us compile as before.
06.33 Let us execute as before.
06.36 We get an unexpected output.


06.39 This is because array index starts from 0.
06.43 Come back to our program. We can see here the array index starts from one.
06.49 Hence it is giving an error. Let us fix the error.
06.54 Type 0 here 1 and 2. Click on Save
07.02 Let us execute. Come back to our terminal
07.05 Let us compile as before. Execute as before
07.09 Yes, it is working.
07.12 Now, we will go back to our slides
07.14 Le us summarize
07.16 In this tutorial we learned,


07.19 Arrays.
07.20 To declare Single Dimensional Arrays.
07.23 To initialize Single Dimensional Arrays.


07.26 example int star[3]={4, 5, 6}
07.31 To add the element of the array, example sum is equal to star 0 plus star 1 plus star 2
07.40 As an assignment,
07.41 Write a program to calculate the difference of the elements stored in an array.


07.47 Watch the video available at the link shown below
07.50 It summarizes the Spoken Tutorial project
07.53 If you do not have good bandwidth, you can download and watch it
07.57 The Spoken Tutorial Project Team
08.00 Conducts workshops using spoken tutorials
08.03 Gives certificates to those who pass an online test
08.06 For more details, please write to, contact@spoken-tutorial.org
08.13 Spoken Tutorial Project is a part of Talk to a Teacher project
08.17 It is supported by the National Mission on Education through ICT, MHRD, Government of India


08.25 More information on this Mission is available at the link shown below
08.30 This is Ashwini Patil from IIT Bombay signing off
08.33 Thank You for watching.

Contributors and Content Editors

Jyotisolanki, Pratik kamble