Difference between revisions of "C-and-C++/C2/First-C++-Program/Gujarati"
From Script | Spoken-Tutorial
Jyotisolanki (Talk | contribs) |
Jyotisolanki (Talk | contribs) |
||
Line 4: | Line 4: | ||
|- | |- | ||
| 00.02 | | 00.02 | ||
− | | | + | | First C++ પ્રોગ્રામ પરનાં સ્પોકન ટ્યુટોરીયલમાં સ્વાગત છે. |
|- | |- | ||
| 00.07 | | 00.07 | ||
− | | | + | |આ ટ્યુટોરીયલમાં આપણે શીખીશું, |
|- | |- | ||
| 00.10 | | 00.10 | ||
− | | | + | |''C++''' પ્રોગ્રામ કેવી રીતે લખવું |
|- | |- | ||
| 00.13 | | 00.13 | ||
− | | | + | | તેને કમ્પાઈલ કેવી રીતે કરવું |
|- | |- | ||
| 00.14 | | 00.14 | ||
− | | | + | |તેને એક્ઝીક્યુટ કેવી રીતે કરવું |
|- | |- | ||
| 00.17 | | 00.17 | ||
− | | | + | |એ સાથે જ અમે સમજાવીશું કેટલાક સામાન્ય એરરો અને તેમનાં ઉકેલો. |
|- | |- | ||
| 00.22 | | 00.22 | ||
− | | | + | | આ ટ્યુટોરીયલને રેકોર્ડ કરવા માટે, હું ઉબુન્ટુ ઓપરેટીંગ સીસ્ટમ આવૃત્તિ ૧૧.૧૦ અને ઉબુન્ટુ પર '''G++''' કમ્પાઈલર આવૃત્તિ ૪.૫.૨ વાપરી રહ્યી છું. |
|- | |- | ||
| 00.35 | | 00.35 | ||
− | | | + | | આ ટ્યુટોરીયલનાં અભ્યાસ માટે, |
|- | |- | ||
| 00.38 | | 00.38 | ||
− | | | + | |તમને ઉબુન્ટુ ઓપરેટીંગ સીસ્ટમ અને એડીટરની જાણ હોવી જરૂરી છે |
|- | |- | ||
| 00.44 | | 00.44 | ||
− | | | + | |'''vim''' અને '''gedit''' એ અમુક એડીટરો છે |
|- | |- | ||
| 00.48 | | 00.48 | ||
− | | | + | |આ ટ્યુટોરીયલમાં હું '''gedit''' નો ઉપયોગ કરી રહ્યી છું |
|- | |- | ||
| 00.51 | | 00.51 | ||
− | | | + | |સંદર્ભિત ટ્યુટોરીયલ માટે અહીં આપેલ અમારી વેબસાઈટનો સંદર્ભ લો: [http://spoken-tutorial.org/ http://spoken-tutorial.org] |
|- | |- | ||
| 00.56 | | 00.56 | ||
− | | | + | |એક ઉદાહરણ દ્વારા ચાલો હું સમજાવું કે '''C++''' પ્રોગ્રામ કેવી રીતે લખવું |
|- | |- | ||
| 01.01 | | 01.01 | ||
− | | | + | | તમારા કીબોર્ડ પર '''Ctrl''', '''Alt''' અને '''T''' કી એકસાથે દાબીને ટર્મિનલ વિન્ડો ખોલો. |
|- | |- | ||
| 01.09 | | 01.09 | ||
− | | | + | | ટેક્સ્ટ એડીટર ખોલવા માટે, ટર્મિનલની અંદર ટાઈપ કરો. |
|- | |- | ||
| 01.13 | | 01.13 | ||
− | | ''' | + | | ''"gedit"''' સ્પેસ '''"talk"''' ડોટ '''".cpp"''' સ્પેસ એમ્પરસેન્ડ '''"&"'''. |
|- | |- | ||
| 01.21 | | 01.21 | ||
− | | | + | |પ્રોમ્પ્ટને ખાલી કરવા માટે આપણે '''"&"''' વાપરીએ છીએ. |
|- | |- | ||
| 01.25 | | 01.25 | ||
− | | | + | |નોંધ લો કે દરેક '''C++ ''' ફાઈલોનું એક્સટેન્શન '''".cpp"''' રહેશે |
|- | |- | ||
| 01.31 | | 01.31 | ||
− | | | + | | હવે '''Enter''' દબાવો |
|- | |- | ||
| 01.33 | | 01.33 | ||
− | | | + | |ટેક્સ્ટ એડીટર ખુલી ગયું છે. |
|- | |- | ||
| 01.36 | | 01.36 | ||
− | | | + | | ચાલો પ્રોગ્રામ લખવાનું શરૂઆત કરીએ. |
|- | |- | ||
| 01.38 | | 01.38 | ||
− | | | + | | ટાઈપ કરો ડબલ સ્લેશ '''"//"''' સ્પેસ |
|- | |- | ||
Line 96: | Line 96: | ||
|- | |- | ||
| 01.44 | | 01.44 | ||
− | | | + | |અહીં, ડબલ સ્લેશનો ઉપયોગ લાઈનને કમેન્ટ કરવા માટે થાય છે |
|- | |- | ||
| 01.49 | | 01.49 | ||
− | | | + | | કમેન્ટ એ પ્રોગ્રામનાં પ્રવાહને સમજવા માટે ઉપયોગી નીવડે છે |
|- | |- | ||
| 01.52 | | 01.52 | ||
− | | | + | |તે દસ્તાવેજીકરણ માટે ઉપયોગી છે |
|- | |- | ||
| 01.55 | | 01.55 | ||
− | | | + | |તે આપણને પ્રોગ્રામ વિશે માહિતી આપે છે |
|- | |- | ||
| 01.59 | | 01.59 | ||
− | | | + | | ડબલ સ્લેશને એકલ લાઈન કમેન્ટ તરીકે બોલાવાય છે. હવે '''Enter''' દબાવો. |
|- | |- | ||
| 02.05 | | 02.05 | ||
− | | | + | | ટાઈપ કરો હેશ '''"#include"''' સ્પેસ ખુલ્લું ખૂણાનું કૌંસ બંધ ખૂણાનું કૌંસ. |
|- | |- | ||
| 02.13 | | 02.13 | ||
− | | | + | |પહેલા કૌંસને પૂરું કરવું, અને ત્યારબાદ તેની અંદર લખવાનું ચાલુ કરવું તે એક સારો પ્રયાસ છે |
|- | |- | ||
| 02.20 | | 02.20 | ||
− | | | + | | હવે કૌંસની અંદર, ટાઈપ કરો '''"iostream"'''. |
|- | |- | ||
| 02.23 | | 02.23 | ||
− | | | + | | અહીં '''iostream''' એ હેડર ફાઈલ છે |
|- | |- | ||
| 02.26 | | 02.26 | ||
− | | | + | | આ ફાઈલ '''C++''' માં પ્રમાણભૂત ઈનપુટ આઉટપુટની જાહેરાતનો સમાવેશ કરે છે. હવે '''Enter''' દબાવો. |
|- | |- | ||
| 02.35 | | 02.35 | ||
− | | | + | | ટાઈપ કરો '''"using"''' સ્પેસ '''"namespace"''' સ્પેસ '''"std"''' અને એક અર્ધવિરામ '''";"'''. . |
|- | |- | ||
|02.45 | |02.45 | ||
− | | | + | | 'using''' સ્ટેટમેંટ કમ્પાઈલરને સૂચિત કરે છે કે તમે '''std namespace''' નો ઉપયોગ કરવા માટે ઈચ્છો છો |
|- | |- | ||
| 02.52 | | 02.52 | ||
− | | | + | | 'namespace''' નો ઉદ્દેશ નામ અથડામણને ટાળવું છે |
|- | |- | ||
| 02.56 | | 02.56 | ||
− | | | + | |આ કરાય છે આઇડેન્ટીફાયરોનાં નામને સ્થાનીકરણ કરવાથી |
|- | |- | ||
|03.01 | |03.01 | ||
− | | | + | | તે એક ઘોષણાત્મક વિસ્તાર બનાવે છે અને એક સ્કોપ વ્યાખ્યિત કરે છે |
|- | |- | ||
| 03.05 | | 03.05 | ||
− | | | + | | '''namespace''' ની અંદર વ્યાખ્યિત કરેલ કંઈપણ તે '''namespace''' નાં સ્કોપમાં હોય છે |
|- | |- | ||
| 03.11 | | 03.11 | ||
− | | | + | |અહીં '''std''' એ '''namespace''' છે જેમાં સમગ્ર '''C++''' લાઈબ્રેરીને ઘોષિત કરવામાં આવી છે. હવે '''Enter''' દબાવો. |
|- | |- | ||
| 03.20 | | 03.20 | ||
− | | | + | | ટાઈપ કરો '''"int"''' સ્પેસ '''"main"''' ખુલ્લું કૌંસ '''"("''' બંધ કૌંસ '''")"'''. |
|- | |- | ||
| 03.27 | | 03.27 | ||
− | | | + | | '''main''' એક વિશેષ ફંક્શન છે |
|- | |- | ||
| 03.30 | | 03.30 | ||
− | | | + | |તે દર્શાવે છે કે પ્રોગ્રામનું એક્ઝીક્યુશન આ લાઈનથી શરૂ થાય છે. |
|- | |- | ||
| 03.35 | | 03.35 | ||
− | | | + | |ખુલ્લું અને બંધ કૌંસને પેરેન્થીસીસ કહેવાય છે. |
+ | |||
|- | |- | ||
| 03.39 | | 03.39 | ||
− | | | + | |પેરેન્થીસીસ પછી આવેલ '''main''' વપરાશકર્તાને દર્શાવે છે કે '''main''' એક ફંક્શન છે. |
|- | |- | ||
| 03.45 | | 03.45 | ||
− | | | + | |અહીં '''int main''' ફંક્શન કોઈપણ આર્ગ્યુંમેંટ લેતું નથી અને ઇન્ટીજર પ્રકારની વેલ્યુ પાછી આપે છે. |
|- | |- | ||
| 03.52 | | 03.52 | ||
− | | | + | | ડેટા પ્રકારો વિશે આપણે બીજા ટ્યુટોરીયલમાં શીખીશું. |
|- | |- | ||
| 03.56 | | 03.56 | ||
− | | | + | |'''main''' ફંક્શન વિશે વધુ જાણવા માટે હવે ચાલો આપણે સ્લાઈડ પર જઈએ. |
|- | |- | ||
| 04.02 | | 04.02 | ||
− | | | + | | દરેક પ્રોગ્રામ પાસે એક '''main''' ફંક્શન હોવું જોઈએ |
|- | |- | ||
| 04.05 | | 04.05 | ||
− | | | + | |''main''' ફંક્શન એક કરતા વધારે ન હોવા જોઈએ |
|- | |- | ||
| 04.09 | | 04.09 | ||
− | | | + | | અન્યથા કમ્પાઈલર પ્રોગ્રામની શરૂઆતની જગ્યા મેળવી શકતું નથી |
|- | |- | ||
| 04.13 | | 04.13 | ||
− | | | + | | કૌંસની ખાલી જોડી દર્શાવે છે કે '''main''' આર્ગ્યુંમેંટ ધરાવતું નથી |
|- | |- | ||
| 04.19 | | 04.19 | ||
− | | | + | | આર્ગ્યુંમેંટોનાં વિચાર પર આવનારા ટ્યુટોરીયલોમાં ચર્ચા કરવામાં આવશે. હવે ચાલો આપણા પ્રોગ્રામ પર પાછા આવીએ. '''enter''' દબાવો. |
|- | |- | ||
| 04.29 | | 04.29 | ||
− | | | + | | ખુલ્લો છગડીયો કૌંસ '''"{"''' ટાઈપ કરો |
|- | |- | ||
| 04.32 | | 04.32 | ||
− | | | + | | ખુલ્લો છગડીયો કૌંસ '''main''' ફંક્શનનાં શરૂઆતને માર્ક કરે છે. |
|- | |- | ||
| 04.37 | | 04.37 | ||
− | | | + | |ત્યારબાદ બંધ છગડીયો કૌંસ '''"}"''' ટાઈપ કરો |
|- | |- | ||
| 04.40 | | 04.40 | ||
− | | | + | |બંધ છગડીયો કૌંસ '''main''' ફંક્શનની સમાપ્તિ દર્શાવે છે. |
|- | |- | ||
| 04.45 | | 04.45 | ||
− | | | + | |હવે કૌંસની અંદર '''enter''' બે વાર દબાવો |
|- | |- | ||
| 04.49 | | 04.49 | ||
− | | | + | |કર્સરને એક લાઈન ઉપર ખસેડો. |
|- | |- | ||
|04.51 | |04.51 | ||
− | | | + | |વચ્ચે વચ્ચે કાપા રાખવાથી કોડ વાંચવાનું સરળ બને છે |
|- | |- | ||
| 04.55 | | 04.55 | ||
− | | | + | |તે એરરોનાં સ્થાનને ઝડપથી શોધવા માટે પણ મદદ કરે છે |
|- | |- | ||
| 04.58 | | 04.58 | ||
− | | | + | |તો ચાલો અહીં સ્પેસ આપીએ. |
|- | |- | ||
| 05.01 | | 05.01 | ||
− | | | + | |અને ટાઈપ કરો '''"cout"''' સ્પેસ બે ખુલ્લા ખૂણાનાં કૌંસ |
|- | |- | ||
| 05.08 | | 05.08 | ||
− | | | + | | અહીં '''cout''' એ આઉટપુટને ટર્મિનલ પર પ્રીંટ કરવા માટેનું એક પ્રમાણભૂત '''C++''' ફંક્શન છે. |
− | + | ||
|- | |- | ||
| 05.14 | | 05.14 | ||
− | | | + | |હવે કૌંસ પછીથી, બે અવતરણમાં ટાઈપ કરો |
|- | |- | ||
| 05.18 | | 05.18 | ||
− | | | + | |''cout''' ફંક્શનમાં બે અવતરણની અંદર આવેલ કંઈપણ લખાણ એ પ્રીંટ થશે. હવે અવતરણમાં ટાઈપ કરો '''"Talk to a teacher backslash \n"'''. |
|- | |- | ||
| 05.31 | | 05.31 | ||
− | | | + | | અહીં '''\n''' એ નવી લાઈનનું પ્રતિક છે |
|- | |- | ||
| 05.35 | | 05.35 | ||
− | | | + | | પરિણામ સ્વરૂપે, '''cout''' ફંક્શનનાં એક્ઝીક્યુશન બાદ, કર્સર નવી લાઈન પર ખસે છે. |
|- | |- | ||
| 05.41 | | 05.41 | ||
− | | | + | |દરેક '''C++''' સ્ટેટમેંટનો અર્ધવિરામ દ્વારા અંત થવો જોઈએ |
|- | |- | ||
| 05.45 | | 05.45 | ||
− | | | + | |એટલા માટે તેને આ લાઈનની અંતમાં ટાઈપ કરો. |
|- | |- | ||
| 05.48 | | 05.48 | ||
− | | | + | | અર્ધવિરામ એક સ્ટેટમેંટ ટર્મીનેટર તરીકે વર્તે છે. હવે '''Enter''' દબાવો. |
|- | |- | ||
| 05.53 | | 05.53 | ||
− | | | + | | અહીં સ્પેસ આપો અને ટાઈપ કરો '''"return"''' સ્પેસ '''"0"''' અને અર્ધવિરામ '''";"'''. |
|- | |- | ||
| 06.00 | | 06.00 | ||
− | | | + | |આ સ્ટેટમેંટ ઇન્ટીજર શૂન્ય પાછું આપે છે |
− | + | ||
|- | |- | ||
| 06.03 | | 06.03 | ||
− | | | + | | આ ફંક્શન માટે ઇન્ટીજર પાછું આવવું જોઈએ |
|- | |- | ||
| 06.06 | | 06.06 | ||
− | | | + | | કારણ કે ફંક્શન પ્રકાર '''int''' છે |
|- | |- | ||
| 06.10 | | 06.10 | ||
− | | | + | | ''return''' સ્ટેટમેંટ એક્ઝીક્યુટેબલ સ્ટેટમેંટની સમાપ્તિ માર્ક કરે છે |
|- | |- | ||
| 06.15 | | 06.15 | ||
− | | | + | | આપણે રીટર્ન વેલ્યુઓ વિશે વધુ બીજા ટ્યુટોરીયલમાં શીખીશું. |
|- | |- | ||
| 06.20 | | 06.20 | ||
− | | | + | |હવે ફાઈલને સંગ્રહવા માટે '''"Save"''' બટન પર ક્લિક કરો |
|- | |- | ||
| 06.23 | | 06.23 | ||
− | | | + | | ફાઈલને વારંવાર સંગ્રહિત કરવું એ એક સારી આદત છે |
|- | |- | ||
| 06.26 | | 06.26 | ||
− | | | + | | આ તમને ઓચિંતા પાવર નિષ્ફળતાઓમાંથી બચાવશે |
|- | |- | ||
| 06.30 | | 06.30 | ||
− | | | + | | સાથે જ આ તમને એ કિસ્સામાં પણ મદદરૂપ નીવડશે જયારે એપ્લીકેશન ખોરવાઈ ગયી હોય. |
|- | |- | ||
| 06.34 | | 06.34 | ||
− | | | + | | ચાલો હવે પ્રોગ્રામને કમ્પાઈલ કરીએ. |
|- | |- | ||
| 06.37 | | 06.37 | ||
− | | | + | | ટર્મિનલ પર પાછા આવીએ |
|- | |- | ||
| 06.39 | | 06.39 | ||
− | | | + | | ટાઈપ કરો '''"g++"''' સ્પેસ '''"talk.cpp"''' સ્પેસ હાયફન '''"-o"''' સ્પેસ '''"output"'''. |
|- | |- | ||
| 06.49 | | 06.49 | ||
− | | | + | |અહીં '''g++''' એ '''C++''' પ્રોગ્રામને કમ્પાઈલ કરવા માટે ઉપયોગમાં આવનાર કમ્પાઈલર છે |
|- | |- | ||
| 06.55 | | 06.55 | ||
− | | | + | |''talk.cpp''' એ આપણા ફાઈલનું નામ છે |
|- | |- | ||
| 06.59 | | 06.59 | ||
− | | '''-o output''' | + | | '''-o output''' દર્શાવે છે કે એક્ઝીક્યુટેબલ આઉટપુટ ફાઈલ પર જવું જોઈએ. હવે '''enter''' દબાવો |
|- | |- | ||
| 07.07 | | 07.07 | ||
− | | | + | | આપણે જોઈએ છીએ કે પ્રોગ્રામ કમ્પાઈલ થઇ ગયું છે. |
|- | |- | ||
| 07.10 | | 07.10 | ||
− | | | + | | '''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 | અહીં std એ namespace છે જેમાં સમગ્ર 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 |