Difference between revisions of "C-and-C++/C2/First-C++-Program/Gujarati"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 4: Line 4:
 
|-
 
|-
 
| 00.02
 
| 00.02
| Welcome to the spoken tutorial on First C++ program.  
+
| First C++ પ્રોગ્રામ પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે.
  
 
|-
 
|-
 
| 00.07
 
| 00.07
| In this tutorial I am going to explain,  
+
|આ ટ્યુટોરીયલમાં આપણે શીખીશું,  
  
 
|-
 
|-
 
| 00.10
 
| 00.10
| How to write a C++ program
+
|''C++''' પ્રોગ્રામ કેવી રીતે લખવું
  
 
|-
 
|-
 
| 00.13
 
| 00.13
| How to compile it
+
| તેને કમ્પાઈલ કેવી રીતે કરવું
  
 
|-  
 
|-  
 
| 00.14
 
| 00.14
| How to execute it
+
|તેને એક્ઝીક્યુટ કેવી રીતે કરવું
  
 
|-
 
|-
 
| 00.17
 
| 00.17
| We will also explain some common errors and their solution.  
+
|એ સાથે જ અમે સમજાવીશું કેટલાક સામાન્ય એરરો અને તેમનાં ઉકેલો.  
  
 
|-
 
|-
 
| 00.22
 
| 00.22
| To record this tutorial, I am using Ubuntu operating system version 11.10 and G++ Compiler version 4.5.2 on Ubuntu.
+
| આ ટ્યુટોરીયલને રેકોર્ડ કરવા માટે, હું ઉબુન્ટુ ઓપરેટીંગ સીસ્ટમ આવૃત્તિ ૧૧.૧૦ અને ઉબુન્ટુ પર '''G++''' કમ્પાઈલર આવૃત્તિ ૪..૨ વાપરી રહ્યી છું.
  
 
|-
 
|-
 
| 00.35
 
| 00.35
| To practice this tutorial,  
+
| આ ટ્યુટોરીયલનાં અભ્યાસ માટે,
  
 
|-
 
|-
 
| 00.38
 
| 00.38
| You should be familiar with Ubuntu Operating System and an Editor
+
|તમને ઉબુન્ટુ ઓપરેટીંગ સીસ્ટમ અને એડીટરની જાણ હોવી જરૂરી છે
  
 
|-
 
|-
 
| 00.44
 
| 00.44
|Some editors are vim and gedit
+
|'''vim''' અને '''gedit''' એ અમુક એડીટરો છે
  
 
|-
 
|-
 
| 00.48
 
| 00.48
| I am using gedit in this tutorial
+
|આ ટ્યુટોરીયલમાં હું '''gedit''' નો ઉપયોગ કરી રહ્યી છું 
  
 
|-
 
|-
 
| 00.51
 
| 00.51
| For relevant tutorial Please visit our website: [http://spoken-tutorial.org/ http://spoken-tutorial.org]  
+
|સંદર્ભિત ટ્યુટોરીયલ માટે અહીં આપેલ અમારી વેબસાઈટનો સંદર્ભ લો: [http://spoken-tutorial.org/ http://spoken-tutorial.org]  
  
 
|-
 
|-
 
| 00.56
 
| 00.56
| Let me tell you how to write a C++ program through an example
+
|એક ઉદાહરણ દ્વારા ચાલો હું સમજાવું કે '''C++''' પ્રોગ્રામ કેવી રીતે લખવું 
  
 
|-
 
|-
 
| 01.01
 
| 01.01
| Open the  terminal Window using '''Ctrl, Alt and T keys''' simultaneously on your keyboard.
+
| તમારા કીબોર્ડ પર '''Ctrl''', '''Alt''' અને '''T''' કી એકસાથે દાબીને ટર્મિનલ વિન્ડો ખોલો.
  
 
|-
 
|-
 
| 01.09
 
| 01.09
| To open the text editor, type under terminal.
+
| ટેક્સ્ટ એડીટર ખોલવા માટે, ટર્મિનલની અંદર ટાઈપ કરો.  
  
 
|-
 
|-
 
| 01.13
 
| 01.13
| '''“gedit”''' space '''“talk”''' dot '''“.cpp”''' space ampersand '''&”.'''
+
| ''"gedit"''' સ્પેસ '''"talk"''' ડોટ '''".cpp"''' સ્પેસ એમ્પરસેન્ડ '''"&"'''.
  
 
|-
 
|-
 
| 01.21
 
| 01.21
| We use the '''&''' to free up the prompt.
+
|પ્રોમ્પ્ટને ખાલી કરવા માટે આપણે '''"&"''' વાપરીએ છીએ.
  
 
|-
 
|-
 
| 01.25
 
| 01.25
| Please note that all the C++ files will have the extension '''.cpp”'''
+
|નોંધ લો કે દરેક '''C++ ''' ફાઈલોનું એક્સટેન્શન '''".cpp"''' રહેશે 
  
 
|-
 
|-
 
| 01.31
 
| 01.31
| Now  Press '''Enter'''
+
| હવે '''Enter''' દબાવો
  
 
|-
 
|-
 
| 01.33
 
| 01.33
|the text editor has opened.  
+
|ટેક્સ્ટ એડીટર ખુલી ગયું છે.  
  
 
|-
 
|-
 
| 01.36
 
| 01.36
| Let us start to write a program.
+
| ચાલો પ્રોગ્રામ લખવાનું શરૂઆત કરીએ.
  
 
|-
 
|-
 
| 01.38
 
| 01.38
| Type double slash '''//''' space
+
| ટાઈપ કરો ડબલ સ્લેશ '''"//"''' સ્પેસ
  
 
|-
 
|-
Line 96: Line 96:
 
|-
 
|-
 
| 01.44
 
| 01.44
| Here, double slash is used to comment the line
+
|અહીં, ડબલ સ્લેશનો ઉપયોગ લાઈનને કમેન્ટ કરવા માટે થાય છે 
  
 
|-
 
|-
 
| 01.49
 
| 01.49
| Comments are used to understand the flow of program
+
| કમેન્ટ એ પ્રોગ્રામનાં પ્રવાહને સમજવા માટે ઉપયોગી નીવડે છે 
  
 
|-
 
|-
 
| 01.52
 
| 01.52
| It is useful for documentation
+
|તે દસ્તાવેજીકરણ માટે ઉપયોગી છે
  
 
|-
 
|-
 
| 01.55
 
| 01.55
| It gives us information about the program
+
|તે આપણને પ્રોગ્રામ વિશે માહિતી આપે છે
  
 
|-
 
|-
 
| 01.59
 
| 01.59
| The double slash is called as single line comment.Now press Enter.
+
| ડબલ સ્લેશને એકલ લાઈન કમેન્ટ તરીકે બોલાવાય છે. હવે '''Enter''' દબાવો.
  
 
|-
 
|-
 
| 02.05
 
| 02.05
| Type hash '''#include”''' space opening angle bracket ''' ''closing angle bracket ''' .
+
| ટાઈપ કરો હેશ '''"#include"''' સ્પેસ ખુલ્લું ખૂણાનું કૌંસ બંધ ખૂણાનું કૌંસ.
  
  
 
|-
 
|-
 
| 02.13
 
| 02.13
|It is  a good practice to complete the brackets first, and then start writing inside it
+
|પહેલા કૌંસને પૂરું કરવું, અને ત્યારબાદ તેની અંદર લખવાનું ચાલુ કરવું તે એક સારો પ્રયાસ છે 
  
 
|-
 
|-
 
| 02.20
 
| 02.20
| Now Inside the bracket, type '''“iostream”''' .
+
| હવે કૌંસની અંદર, ટાઈપ કરો '''"iostream"'''.
  
 
|-
 
|-
 
| 02.23
 
| 02.23
| Here '''iostream''' is a '''header file'''
+
| અહીં '''iostream''' એ હેડર ફાઈલ છે
  
 
|-
 
|-
 
| 02.26
 
| 02.26
| This file includes the declaration of  standard input output functions  in C++.Now press Enter
+
| આ ફાઈલ '''C++''' માં પ્રમાણભૂત ઈનપુટ આઉટપુટની જાહેરાતનો સમાવેશ કરે છે. હવે '''Enter''' દબાવો.
  
 
|-
 
|-
 
| 02.35
 
| 02.35
| Type '''“using”''' space '''“namespace”''' space '''“std”''' and a semicolon ''';''' .
+
| ટાઈપ કરો '''"using"''' સ્પેસ '''"namespace"''' સ્પેસ '''"std"''' અને એક અર્ધવિરામ '''";"'''. .
  
 
|-
 
|-
 
|02.45
 
|02.45
| The '''using''' statement informs the compiler that you want to use the '''std namespace'''
+
| 'using''' સ્ટેટમેંટ કમ્પાઈલરને સૂચિત કરે છે કે તમે '''std namespace''' નો ઉપયોગ કરવા માટે ઈચ્છો છો
  
 
|-
 
|-
 
| 02.52
 
| 02.52
| The purpose of '''namespace''' is to avoid name collisions
+
| 'namespace''' નો ઉદ્દેશ નામ અથડામણને ટાળવું છે
  
 
|-
 
|-
 
| 02.56
 
| 02.56
| It is done by localizing the names of identifiers
+
|આ કરાય છે આઇડેન્ટીફાયરોનાં નામને સ્થાનીકરણ કરવાથી 
  
 
|-
 
|-
 
|03.01
 
|03.01
| It creates a declarative region and defines a scope
+
| તે એક ઘોષણાત્મક વિસ્તાર બનાવે છે અને એક સ્કોપ વ્યાખ્યિત કરે છે
  
 
|-
 
|-
 
| 03.05
 
| 03.05
| Anything defined within a '''namespace''' is in the SCOPE of that namespace
+
| '''namespace''' ની અંદર વ્યાખ્યિત કરેલ કંઈપણ તે '''namespace''' નાં સ્કોપમાં હોય છે 
  
 
|-
 
|-
 
| 03.11
 
| 03.11
|Here '''std''' is the '''namespace''' in which entire standard C++ library is declared. Now press '''Enter'''.
+
|અહીં '''std''' '''namespace''' છે જેમાં સમગ્ર '''C++''' લાઈબ્રેરીને ઘોષિત કરવામાં આવી છે. હવે '''Enter''' દબાવો.
  
  
 
|-  
 
|-  
 
| 03.20
 
| 03.20
| Type '''“int”''' space '''“main”''' opening bracket '''(''' closing bracket ''')''' .
+
| ટાઈપ કરો '''"int"''' સ્પેસ '''"main"''' ખુલ્લું કૌંસ '''"("''' બંધ કૌંસ '''")"'''.
  
  
 
|-
 
|-
 
| 03.27
 
| 03.27
| '''main''' is a special '''function''' 
+
| '''main''' એક વિશેષ ફંક્શન છે
  
 
|-
 
|-
 
| 03.30
 
| 03.30
| It denotes that the execution of the program begins from this line.
+
|તે દર્શાવે છે કે પ્રોગ્રામનું એક્ઝીક્યુશન આ લાઈનથી શરૂ થાય છે.    
  
 
|-
 
|-
 
| 03.35
 
| 03.35
|The opening and the closing bracket is called as'' Parenthesis''.
+
|ખુલ્લું અને બંધ કૌંસને પેરેન્થીસીસ કહેવાય છે.
 +
 
 
|-
 
|-
 
| 03.39
 
| 03.39
| Parenthesis followed by '''main''' tells the user that '''main''' is a '''function.'''
+
|પેરેન્થીસીસ પછી આવેલ '''main''' વપરાશકર્તાને દર્શાવે છે કે '''main''' એક ફંક્શન છે.  
  
 
|-
 
|-
 
| 03.45
 
| 03.45
| Here the '''int''' '''main''' '''function''' takes no '''arguments''' and returns a value of type integer.
+
|અહીં '''int main''' ફંક્શન કોઈપણ આર્ગ્યુંમેંટ લેતું નથી અને ઇન્ટીજર પ્રકારની વેલ્યુ પાછી આપે છે.  
  
 
|-
 
|-
 
| 03.52
 
| 03.52
| We will learn about data types in another tutorial.
+
| ડેટા પ્રકારો વિશે આપણે બીજા ટ્યુટોરીયલમાં શીખીશું.  
  
 
|-
 
|-
 
| 03.56
 
| 03.56
|Now  Let us switch to the slides to know more about  main function.
+
|'''main''' ફંક્શન વિશે વધુ જાણવા માટે હવે ચાલો આપણે સ્લાઈડ પર જઈએ.
  
 
|-
 
|-
 
| 04.02
 
| 04.02
| Every '''program'''should have one main function
+
| દરેક પ્રોગ્રામ પાસે એક '''main''' ફંક્શન હોવું જોઈએ  
  
 
|-
 
|-
 
| 04.05
 
| 04.05
| There should NOT be more than one “main” function
+
|''main''' ફંક્શન એક કરતા વધારે ન હોવા જોઈએ
  
 
|-
 
|-
 
| 04.09
 
| 04.09
| Otherwise the compiler cannot locate the beginning of the program
+
| અન્યથા કમ્પાઈલર પ્રોગ્રામની શરૂઆતની જગ્યા મેળવી શકતું નથી
  
 
|-
 
|-
 
| 04.13
 
| 04.13
| The empty pair of parentheses indicates that main has no '''arguments'''
+
| કૌંસની ખાલી જોડી દર્શાવે છે કે '''main''' આર્ગ્યુંમેંટ ધરાવતું નથી
  
 
|-
 
|-
 
| 04.19
 
| 04.19
| The concept of '''arguments''' will be discussed in  the upcoming tutorials. Now come back to our program. press enter.
+
| આર્ગ્યુંમેંટોનાં વિચાર પર આવનારા ટ્યુટોરીયલોમાં ચર્ચા કરવામાં આવશે. હવે ચાલો આપણા પ્રોગ્રામ પર પાછા આવીએ. '''enter''' દબાવો.
  
 
|-
 
|-
 
| 04.29
 
| 04.29
| Type opening curly bracket '''{'''
+
| ખુલ્લો છગડીયો કૌંસ '''"{"''' ટાઈપ કરો
  
 
|-
 
|-
 
| 04.32
 
| 04.32
| The opening  curly  bracket marks the beginning of the '''function main. '''
+
| ખુલ્લો છગડીયો કૌંસ '''main''' ફંક્શનનાં શરૂઆતને માર્ક કરે છે.
  
 
|-
 
|-
 
| 04.37
 
| 04.37
|Then Type closing curly bracket '''}'''
+
|ત્યારબાદ બંધ છગડીયો કૌંસ '''"}"''' ટાઈપ કરો 
  
 
|-
 
|-
 
| 04.40
 
| 04.40
| The closing bracket indicates the end of the '''function main '''
+
|બંધ છગડીયો કૌંસ '''main''' ફંક્શનની સમાપ્તિ દર્શાવે છે.
  
 
|-
 
|-
 
| 04.45
 
| 04.45
|Now  Inside the bracket press enter twice
+
|હવે કૌંસની અંદર '''enter''' બે વાર દબાવો
  
 
|-
 
|-
 
| 04.49
 
| 04.49
| Move the cursor one line up.
+
|કર્સરને એક લાઈન ઉપર ખસેડો.  
  
 
|-
 
|-
 
|04.51
 
|04.51
| Indentation makes the code easier to read
+
|વચ્ચે વચ્ચે કાપા રાખવાથી કોડ વાંચવાનું સરળ બને છે
  
 
|-
 
|-
 
| 04.55
 
| 04.55
| It also helps to locate errors faster
+
|તે એરરોનાં સ્થાનને ઝડપથી શોધવા માટે પણ મદદ કરે છે
  
 
|-
 
|-
 
| 04.58
 
| 04.58
|So let us  give a  space here.
+
|તો ચાલો અહીં સ્પેસ આપીએ.
  
 
|-
 
|-
 
| 05.01
 
| 05.01
|And type '''“cout”''' space two opening angle bracket ''''
+
|અને ટાઈપ કરો '''"cout"''' સ્પેસ બે ખુલ્લા ખૂણાનાં કૌંસ
  
 
|-
 
|-
 
| 05.08
 
| 05.08
| Here '''cout '''is a standard '''C++ function''' to print the output on the terminal.
+
| અહીં '''cout''' એ આઉટપુટને ટર્મિનલ પર પ્રીંટ કરવા માટેનું એક પ્રમાણભૂત '''C++''' ફંક્શન છે.  
 
+
  
  
 
|-
 
|-
 
| 05.14
 
| 05.14
|Now  after the brackets, type within  double quotes '''
+
|હવે કૌંસ પછીથી, બે અવતરણમાં ટાઈપ કરો
  
 
|-
 
|-
 
| 05.18
 
| 05.18
|Anything within the double quotes in the '''cout ''' functions will be printed. Now inside a quote type“Talk to a teacher backslash \n”'''.
+
|''cout''' ફંક્શનમાં બે અવતરણની અંદર આવેલ કંઈપણ લખાણ એ પ્રીંટ થશે. હવે અવતરણમાં ટાઈપ કરો '''"Talk to a teacher backslash \n"'''.    
  
 
|-
 
|-
 
| 05.31
 
| 05.31
| Here '''\n''' signifies newline
+
| અહીં '''\n''' એ નવી લાઈનનું પ્રતિક છે 
  
 
|-
 
|-
 
| 05.35
 
| 05.35
| As a result, after execution of the '''cout function''', the cursor moves to the new line.
+
| પરિણામ સ્વરૂપે, '''cout''' ફંક્શનનાં એક્ઝીક્યુશન બાદ, કર્સર નવી લાઈન પર ખસે છે.  
  
 
|-
 
|-
 
| 05.41
 
| 05.41
| Every C++ statement must end with a '''semicolon'''  
+
|દરેક '''C++''' સ્ટેટમેંટનો અર્ધવિરામ દ્વારા અંત થવો જોઈએ 
  
  
 
|-
 
|-
 
| 05.45
 
| 05.45
| Hence type it at the end of this line.
+
|એટલા માટે તેને આ લાઈનની અંતમાં ટાઈપ કરો.
  
 
|-
 
|-
 
| 05.48
 
| 05.48
| Semicolon acts as a statement terminator. Now press Enter.
+
| અર્ધવિરામ એક સ્ટેટમેંટ ટર્મીનેટર તરીકે વર્તે છે. હવે '''Enter''' દબાવો.  
  
 
|-
 
|-
 
| 05.53
 
| 05.53
| Give a space here and  Type '''“return”''' space '''“0”''' and a semicolon ''';”.'''
+
| અહીં સ્પેસ આપો અને ટાઈપ કરો '''"return"''' સ્પેસ '''"0"''' અને અર્ધવિરામ '''";"'''
  
 
|-
 
|-
 
| 06.00
 
| 06.00
| This statement returns the integer zero
+
|આ સ્ટેટમેંટ ઇન્ટીજર શૂન્ય પાછું આપે છે 
 
+
  
 
|-
 
|-
 
| 06.03
 
| 06.03
| An integer has to be returned for this '''function'''
+
| આ ફંક્શન માટે ઇન્ટીજર પાછું આવવું જોઈએ
  
  
 
|-
 
|-
 
| 06.06
 
| 06.06
| Because the '''function''' type is '''int'''
+
| કારણ કે ફંક્શન પ્રકાર '''int''' છે 
  
  
 
|-
 
|-
 
| 06.10
 
| 06.10
| The '''return''' statement marks the end of executable statements
+
| ''return''' સ્ટેટમેંટ એક્ઝીક્યુટેબલ સ્ટેટમેંટની સમાપ્તિ માર્ક કરે છે
  
  
 
|-
 
|-
 
| 06.15
 
| 06.15
| We will learn more about the returned values in another tutorial.
+
| આપણે રીટર્ન વેલ્યુઓ વિશે વધુ બીજા ટ્યુટોરીયલમાં શીખીશું.  
  
 
|-
 
|-
 
| 06.20
 
| 06.20
| Now click on '''“Save”''' button to save the file
+
|હવે ફાઈલને સંગ્રહવા માટે '''"Save"''' બટન પર ક્લિક કરો 
  
  
 
|-
 
|-
 
| 06.23
 
| 06.23
| It is a good habit to save files frequently
+
| ફાઈલને વારંવાર સંગ્રહિત કરવું એ એક સારી આદત છે
  
  
 
|-
 
|-
 
| 06.26
 
| 06.26
| This will protect you from sudden power failures
+
| આ તમને ઓચિંતા પાવર નિષ્ફળતાઓમાંથી બચાવશે
  
  
 
|-
 
|-
 
| 06.30
 
| 06.30
| It will also be useful in case the applications were to crash.
+
| સાથે જ આ તમને એ કિસ્સામાં પણ મદદરૂપ નીવડશે જયારે એપ્લીકેશન ખોરવાઈ ગયી હોય.  
  
 
|-
 
|-
 
| 06.34
 
| 06.34
| Let us now compile the program.
+
| ચાલો હવે પ્રોગ્રામને કમ્પાઈલ કરીએ.
  
 
|-
 
|-
 
| 06.37
 
| 06.37
| Come back to a  terminal
+
| ટર્મિનલ પર પાછા આવીએ
  
  
 
|-
 
|-
 
| 06.39
 
| 06.39
| Type '''“g++''' space '''“talk.cpp”''' space hyphen '''-o”''' space '''“output”.'''
+
| ટાઈપ કરો '''"g++"''' સ્પેસ '''"talk.cpp"''' સ્પેસ હાયફન '''"-o"''' સ્પેસ '''"output"'''.
  
 
|-
 
|-
 
| 06.49
 
| 06.49
|Here '''g++''' is the compiler used to compile '''C++ '''programs
+
|અહીં '''g++''' '''C++''' પ્રોગ્રામને કમ્પાઈલ કરવા માટે ઉપયોગમાં આવનાર કમ્પાઈલર છે 
  
  
 
|-
 
|-
 
| 06.55
 
| 06.55
| '''talk.cpp''' is our  filename
+
|''talk.cpp''' એ આપણા ફાઈલનું નામ છે
  
 
|-
 
|-
 
| 06.59
 
| 06.59
| '''-o output''' says that the executable should go to the file output. Now press enter  
+
| '''-o output''' દર્શાવે છે કે એક્ઝીક્યુટેબલ આઉટપુટ ફાઈલ પર જવું જોઈએ. હવે '''enter''' દબાવો
  
 
|-
 
|-
 
| 07.07
 
| 07.07
We see that the program is compiled.
+
આપણે જોઈએ છીએ કે પ્રોગ્રામ કમ્પાઈલ થઇ ગયું છે.
  
 
|-
 
|-
 
| 07.10
 
| 07.10
| By typing '''ls -lrt''', we can see that '''output''' is the last file to be created.
+
| '''ls -lrt''' દબાવવાથી, આપણે જોઈ શકીએ છીએ કે આઉટપુટ એ છેલ્લી બનનારી ફાઈલ છે.
  
 
|-
 
|-

Revision as of 15:46, 10 October 2013

Time' Narration
00.02 First C++ પ્રોગ્રામ પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે.
00.07 આ ટ્યુટોરીયલમાં આપણે શીખીશું,
00.10 C++' પ્રોગ્રામ કેવી રીતે લખવું
00.13 તેને કમ્પાઈલ કેવી રીતે કરવું
00.14 તેને એક્ઝીક્યુટ કેવી રીતે કરવું
00.17 એ સાથે જ અમે સમજાવીશું કેટલાક સામાન્ય એરરો અને તેમનાં ઉકેલો.
00.22 આ ટ્યુટોરીયલને રેકોર્ડ કરવા માટે, હું ઉબુન્ટુ ઓપરેટીંગ સીસ્ટમ આવૃત્તિ ૧૧.૧૦ અને ઉબુન્ટુ પર G++ કમ્પાઈલર આવૃત્તિ ૪.૫.૨ વાપરી રહ્યી છું.
00.35 આ ટ્યુટોરીયલનાં અભ્યાસ માટે,
00.38 તમને ઉબુન્ટુ ઓપરેટીંગ સીસ્ટમ અને એડીટરની જાણ હોવી જરૂરી છે
00.44 vim અને gedit એ અમુક એડીટરો છે
00.48 આ ટ્યુટોરીયલમાં હું gedit નો ઉપયોગ કરી રહ્યી છું
00.51 સંદર્ભિત ટ્યુટોરીયલ માટે અહીં આપેલ અમારી વેબસાઈટનો સંદર્ભ લો: http://spoken-tutorial.org
00.56 એક ઉદાહરણ દ્વારા ચાલો હું સમજાવું કે C++ પ્રોગ્રામ કેવી રીતે લખવું
01.01 તમારા કીબોર્ડ પર Ctrl, Alt અને T કી એકસાથે દાબીને ટર્મિનલ વિન્ડો ખોલો.
01.09 ટેક્સ્ટ એડીટર ખોલવા માટે, ટર્મિનલની અંદર ટાઈપ કરો.
01.13 "gedit"' સ્પેસ "talk" ડોટ ".cpp" સ્પેસ એમ્પરસેન્ડ "&".
01.21 પ્રોમ્પ્ટને ખાલી કરવા માટે આપણે "&" વાપરીએ છીએ.
01.25 નોંધ લો કે દરેક C++ ફાઈલોનું એક્સટેન્શન ".cpp" રહેશે
01.31 હવે Enter દબાવો
01.33 ટેક્સ્ટ એડીટર ખુલી ગયું છે.
01.36 ચાલો પ્રોગ્રામ લખવાનું શરૂઆત કરીએ.
01.38 ટાઈપ કરો ડબલ સ્લેશ "//" સ્પેસ
01.41 “My first C++ program”.
01.44 અહીં, ડબલ સ્લેશનો ઉપયોગ લાઈનને કમેન્ટ કરવા માટે થાય છે
01.49 કમેન્ટ એ પ્રોગ્રામનાં પ્રવાહને સમજવા માટે ઉપયોગી નીવડે છે
01.52 તે દસ્તાવેજીકરણ માટે ઉપયોગી છે
01.55 તે આપણને પ્રોગ્રામ વિશે માહિતી આપે છે
01.59 ડબલ સ્લેશને એકલ લાઈન કમેન્ટ તરીકે બોલાવાય છે. હવે Enter દબાવો.
02.05 ટાઈપ કરો હેશ "#include" સ્પેસ ખુલ્લું ખૂણાનું કૌંસ બંધ ખૂણાનું કૌંસ.


02.13 પહેલા કૌંસને પૂરું કરવું, અને ત્યારબાદ તેની અંદર લખવાનું ચાલુ કરવું તે એક સારો પ્રયાસ છે
02.20 હવે કૌંસની અંદર, ટાઈપ કરો "iostream".
02.23 અહીં iostream એ હેડર ફાઈલ છે
02.26 આ ફાઈલ C++ માં પ્રમાણભૂત ઈનપુટ આઉટપુટની જાહેરાતનો સમાવેશ કરે છે. હવે Enter દબાવો.
02.35 ટાઈપ કરો "using" સ્પેસ "namespace" સ્પેસ "std" અને એક અર્ધવિરામ ";". .
02.45 'using સ્ટેટમેંટ કમ્પાઈલરને સૂચિત કરે છે કે તમે std namespace નો ઉપયોગ કરવા માટે ઈચ્છો છો
02.52 'namespace નો ઉદ્દેશ નામ અથડામણને ટાળવું છે
02.56 આ કરાય છે આઇડેન્ટીફાયરોનાં નામને સ્થાનીકરણ કરવાથી
03.01 તે એક ઘોષણાત્મક વિસ્તાર બનાવે છે અને એક સ્કોપ વ્યાખ્યિત કરે છે
03.05 namespace ની અંદર વ્યાખ્યિત કરેલ કંઈપણ તે namespace નાં સ્કોપમાં હોય છે
03.11 અહીં stdnamespace છે જેમાં સમગ્ર C++ લાઈબ્રેરીને ઘોષિત કરવામાં આવી છે. હવે Enter દબાવો.


03.20 ટાઈપ કરો "int" સ્પેસ "main" ખુલ્લું કૌંસ "(" બંધ કૌંસ ")".


03.27 main એક વિશેષ ફંક્શન છે
03.30 તે દર્શાવે છે કે પ્રોગ્રામનું એક્ઝીક્યુશન આ લાઈનથી શરૂ થાય છે.
03.35 ખુલ્લું અને બંધ કૌંસને પેરેન્થીસીસ કહેવાય છે.
03.39 પેરેન્થીસીસ પછી આવેલ main વપરાશકર્તાને દર્શાવે છે કે main એક ફંક્શન છે.
03.45 અહીં int main ફંક્શન કોઈપણ આર્ગ્યુંમેંટ લેતું નથી અને ઇન્ટીજર પ્રકારની વેલ્યુ પાછી આપે છે.
03.52 ડેટા પ્રકારો વિશે આપણે બીજા ટ્યુટોરીયલમાં શીખીશું.
03.56 main ફંક્શન વિશે વધુ જાણવા માટે હવે ચાલો આપણે સ્લાઈડ પર જઈએ.
04.02 દરેક પ્રોગ્રામ પાસે એક main ફંક્શન હોવું જોઈએ
04.05 main' ફંક્શન એક કરતા વધારે ન હોવા જોઈએ
04.09 અન્યથા કમ્પાઈલર પ્રોગ્રામની શરૂઆતની જગ્યા મેળવી શકતું નથી
04.13 કૌંસની ખાલી જોડી દર્શાવે છે કે main આર્ગ્યુંમેંટ ધરાવતું નથી
04.19 આર્ગ્યુંમેંટોનાં વિચાર પર આવનારા ટ્યુટોરીયલોમાં ચર્ચા કરવામાં આવશે. હવે ચાલો આપણા પ્રોગ્રામ પર પાછા આવીએ. enter દબાવો.
04.29 ખુલ્લો છગડીયો કૌંસ "{" ટાઈપ કરો
04.32 ખુલ્લો છગડીયો કૌંસ main ફંક્શનનાં શરૂઆતને માર્ક કરે છે.
04.37 ત્યારબાદ બંધ છગડીયો કૌંસ "}" ટાઈપ કરો
04.40 બંધ છગડીયો કૌંસ main ફંક્શનની સમાપ્તિ દર્શાવે છે.
04.45 હવે કૌંસની અંદર enter બે વાર દબાવો
04.49 કર્સરને એક લાઈન ઉપર ખસેડો.
04.51 વચ્ચે વચ્ચે કાપા રાખવાથી કોડ વાંચવાનું સરળ બને છે
04.55 તે એરરોનાં સ્થાનને ઝડપથી શોધવા માટે પણ મદદ કરે છે
04.58 તો ચાલો અહીં સ્પેસ આપીએ.
05.01 અને ટાઈપ કરો "cout" સ્પેસ બે ખુલ્લા ખૂણાનાં કૌંસ
05.08 અહીં cout એ આઉટપુટને ટર્મિનલ પર પ્રીંટ કરવા માટેનું એક પ્રમાણભૂત C++ ફંક્શન છે.


05.14 હવે કૌંસ પછીથી, બે અવતરણમાં ટાઈપ કરો
05.18 cout' ફંક્શનમાં બે અવતરણની અંદર આવેલ કંઈપણ લખાણ એ પ્રીંટ થશે. હવે અવતરણમાં ટાઈપ કરો "Talk to a teacher backslash \n".
05.31 અહીં \n એ નવી લાઈનનું પ્રતિક છે
05.35 પરિણામ સ્વરૂપે, cout ફંક્શનનાં એક્ઝીક્યુશન બાદ, કર્સર નવી લાઈન પર ખસે છે.
05.41 દરેક C++ સ્ટેટમેંટનો અર્ધવિરામ દ્વારા અંત થવો જોઈએ


05.45 એટલા માટે તેને આ લાઈનની અંતમાં ટાઈપ કરો.
05.48 અર્ધવિરામ એક સ્ટેટમેંટ ટર્મીનેટર તરીકે વર્તે છે. હવે Enter દબાવો.
05.53 અહીં સ્પેસ આપો અને ટાઈપ કરો "return" સ્પેસ "0" અને અર્ધવિરામ ";".
06.00 આ સ્ટેટમેંટ ઇન્ટીજર શૂન્ય પાછું આપે છે
06.03 આ ફંક્શન માટે ઇન્ટીજર પાછું આવવું જોઈએ


06.06 કારણ કે ફંક્શન પ્રકાર int છે


06.10 return' સ્ટેટમેંટ એક્ઝીક્યુટેબલ સ્ટેટમેંટની સમાપ્તિ માર્ક કરે છે


06.15 આપણે રીટર્ન વેલ્યુઓ વિશે વધુ બીજા ટ્યુટોરીયલમાં શીખીશું.
06.20 હવે ફાઈલને સંગ્રહવા માટે "Save" બટન પર ક્લિક કરો


06.23 ફાઈલને વારંવાર સંગ્રહિત કરવું એ એક સારી આદત છે


06.26 આ તમને ઓચિંતા પાવર નિષ્ફળતાઓમાંથી બચાવશે


06.30 સાથે જ આ તમને એ કિસ્સામાં પણ મદદરૂપ નીવડશે જયારે એપ્લીકેશન ખોરવાઈ ગયી હોય.
06.34 ચાલો હવે પ્રોગ્રામને કમ્પાઈલ કરીએ.
06.37 ટર્મિનલ પર પાછા આવીએ


06.39 ટાઈપ કરો "g++" સ્પેસ "talk.cpp" સ્પેસ હાયફન "-o" સ્પેસ "output".
06.49 અહીં g++C++ પ્રોગ્રામને કમ્પાઈલ કરવા માટે ઉપયોગમાં આવનાર કમ્પાઈલર છે


06.55 talk.cpp' એ આપણા ફાઈલનું નામ છે
06.59 -o output દર્શાવે છે કે એક્ઝીક્યુટેબલ આઉટપુટ ફાઈલ પર જવું જોઈએ. હવે enter દબાવો
07.07 આપણે જોઈએ છીએ કે પ્રોગ્રામ કમ્પાઈલ થઇ ગયું છે.
07.10 ls -lrt દબાવવાથી, આપણે જોઈ શકીએ છીએ કે આઉટપુટ એ છેલ્લી બનનારી ફાઈલ છે.
07.19 Let us execute a program, type dot slash “./output”


07.24 And Press Enter.
07.27 Here the output is displayed as “Talk to a teacher”.
07.31 Now let us see the common errors which we can come across


07.35 switch back to a editor.
07.38 Suppose here we miss the {.
07.42 Now save the file.
07.44 Let us execute.Come back to a terminal
07.48 Now compile and run the program using the command we used before.We see an error
07.55 we see that there is an error at line no.7 in our talk.cpp file


08.02 That Expected curly bracket at the end of input.
08.07 Now Come back to our text editor .
08.09 As i said before the closing curly bracket marks the end of the function main


08.14 Hence re-insert the bracket here. now Save the file.


08.19 Let us execute it again


08.21 You can recall the previously entered commands by using up arrow key


08.26 That is what I did now. Yes it is working.
08.32 I will show you another common error


08.35 Let us switch back to our text editor.
08.38 Now, suppose here we missed std.Let us save the file
08.44 Come back to our terminal . Let us compile .


08.48 We see that there is an errors at line no 3 and line no 6 in our talk.cpp file


08.56 That expected identifier before semicolon and cout was not declared in this scope.
09.05 As cout is the standard C++ library function


09.09 and the entire C++ library function is defined under std namespace


09.15 Hence it is giving an error.
09.18 Let us now fix the error


09.19 Come back to our Text editor type std here
09.23 Let us Save it.
09.25 Let us compile it again.Yes it is working.
09.32 As an assignment,


09.33 Write a program to print your name and city


09.37 We used single line comment in this tutorial


09.40 Now just try to give a multiline comment



09.44 Watch the video available at the link shown http://spoken-tutorial.org /What\_is\_a\_Spoken\_Tutorial


09.47 It summarises the Spoken Tutorial project


09.49 If you do not have good bandwidth, you can download and watch it.
09.53 The Spoken Tutorial Project Team


09.55 Conducts workshops using spoken tutorials


09.58 Gives certificates to those who pass an online test


10.01 For more details, please write to contact @spoken-tutorial.org
10.10 Spoken Tutorial Project is a part of the Talk to a Teacher project
10.14 It is supported by the National Mission on Education through ICT, MHRD, Government of India


10.20 More information on this Mission is available at: http://spoken-tutorial.org\NMEICT-Intro
10.25 This is Ashwini Patil from IIT Bombay signing off


10.28 Thank you for watching

Contributors and Content Editors

Gaurav, Jyotisolanki, Krupali, PoojaMoolya, Pratik kamble