Difference between revisions of "Advance-C/C2/Union-and-Typedef/Gujarati"
From Script | Spoken-Tutorial
Jyotisolanki (Talk | contribs) |
Jyotisolanki (Talk | contribs) |
||
Line 35: | Line 35: | ||
|- | |- | ||
| 00:49 | | 00:49 | ||
− | | '''Typedef ''' | + | | '''Typedef ''' કીવર્ડ વર્તમાન '''type''' અથવા '''user-defined ''' ડેટાટાઈપસ સાંકેતિક નામ આપવા માં મદદ કરે છે. |
|- | |- | ||
| 00:58 | | 00:58 | ||
− | | | + | | કમાંડને માટે '''alias''' (ઉપનામ) વ્યાખ્યિત કરવાનો એક માર્ગ છે. |
|- | |- | ||
| 01:03 | | 01:03 | ||
− | | | + | | આ કોડની સ્પષ્ટતા ને પૂરી પડવામાં મદદ કરે છે. |
|- | |- | ||
| 01:07 | | 01:07 | ||
− | + | આ કોડને સમઝવું અને બદલવાનું સહેલું કરે છે. | |
|- | |- | ||
| 01:12 | | 01:12 | ||
− | | | + | | સિન્ટેક્સ : '''typedef existing_name alias_name'''. ઉદાહરણ : '''typedef unsigned int uint;''' |
|- | |- | ||
| 01:24 | | 01:24 | ||
− | | | + | |ચાલો ઉદાહરણને કોડ આપીએ. |
|- | |- | ||
| 01:28 | | 01:28 | ||
− | | | + | | નોંધ લો કે આપની ફાઈલનું નામ '''pallindrome.c''' છે. |
|- | |- | ||
| 01:34 | | 01:34 | ||
− | | | + | | આ પ્રોગ્રામમાં આપણે તપાસીશું કે આપેલ નંબર '''pallindrome''' (પેલેનડ્રોમ) |
|- | |- | ||
| 01:41 | | 01:41 | ||
− | | | + | | કીવર્ડ નો ઉપયોગ કરીને ''' unsigned int datatype ''' ને '''uint ''' ઉપનામ આપ્યું છે. |
|- | |- | ||
| 01:52 | | 01:52 | ||
− | | | + | | અહી આપણે વેરીએબલને ડીકલેર કરવા માટે ''' uint ''' નો ઉપયોગ કર્યો છે. |
|- | |- | ||
| 01:59 | | 01:59 | ||
− | | | + | | આ '''pallindrome''' ના માટે લોજીક છે. |
|- | |- | ||
| 02:03 | | 02:03 | ||
− | | | + | | હવે પ્રોગ્રામ એક્ઝીક્યુટ કરીએ. |
|- | |- | ||
| 02:06 | | 02:06 | ||
− | | | + | | ટર્મિનલ ખોલવા માટે કીબોર્ડ પર એક સાથે '''Ctrl+Alt+T''' કી દાબવો. |
|- | |- | ||
| 02:16 | | 02:16 | ||
− | | | + | | ટાઈપ કરો ''' gcc space pallindrome dot c space hyphen o space pallindrome'''. '''Enter''' દબાવો. |
|- | |- | ||
| 02:29 | | 02:29 | ||
− | | | + | | ટાઈપ કરો :''' dot slash pallindrome''' |
|- | |- | ||
|02:34 | |02:34 | ||
− | | | + | | આપણે જોઈએ છીએ: '''Enter any three digit number''' |
|- | |- | ||
| 02:38 | | 02:38 | ||
− | | | + | | મેં ''' 121''' ઉમેરીશ. |
|- | |- | ||
| 02:42 | | 02:42 | ||
− | | | + | | આઉટપુટ છે : '''Given number is a palindrome number''' |
|- | |- | ||
Line 111: | Line 111: | ||
|- | |- | ||
| 02:52 | | 02:52 | ||
− | | '''Union''' | + | | '''Union''' વિવિધ ડેટાટાઈપસ ને એક સાથે ગ્રુપ કરવા નું કલેક્શન છે. |
|- | |- | ||
| 02:57 | | 02:57 | ||
− | | '''Union ''' | + | | '''Union ''' તેના બધા મેમ્બરસ માટે એક સમાન સ્ટોરેજ સ્પેસ નિર્ધારિત કરે છે. |
|- | |- | ||
| 03:03 | | 03:03 | ||
− | | | + | | આપણે એક વખત માં યુનિયન ના એક જ મેમ્બર ને એક્સેસ કરી શકીએ છીએ. |
|- | |- | ||
| 03:08 | | 03:08 | ||
− | | ''' | + | | '''સિન્ટેક્સ 1:''' |
− | '''union union_name''' | + | '''union union_name'''છગડીયા કૌંસમાં '''members;''' છગડીયા કૌંસ પછી '''union_variable''' |
− | + | અને '''semi-colon'''. | |
|- | |- | ||
| 03:21 | | 03:21 | ||
− | | | + | | આપણી પાસે વૈકલ્પિક સિન્ટેક્સ પણ છે . |
− | ''' | + | '''સિન્ટેક્સ :''' '''union union_name''' છગડીયા કૌંસમાં '''members;''' છગડીયા કૌંસ પછી '''semi-colon''' '''union union_name union_variable;''' |
|- | |- | ||
| 03:39 | | 03:39 | ||
− | | | + | | ચાલો એક ઉદાહરણ જોઈએ. |
|- | |- | ||
| 03:41 | | 03:41 | ||
− | | | + | | મારી પાસે એક કોડ ફાઈલ છે ચાલો આને જોઈએ. |
|- | |- | ||
| 03:47 | | 03:47 | ||
− | | | + | | નોંધ લો કે આપણી ફાઈલનું નામ '''union dot c''' છે. |
|- | |- | ||
| 03:52 | | 03:52 | ||
− | | | + | | આપણે '''student.''' નામનું '''union''' ડીકલેર કર્યું છે. |
|- | |- | ||
| 03:56 | | 03:56 | ||
− | | | + | | અહી આપણી પાસે ત્રણ વેરીએબલસ છે '''english''', '''maths''' અને ''' science.''' |
|- | |- | ||
|04:02 | |04:02 | ||
− | | | + | | મેઈન ફન્કશન માં આપણે '''union''' વેરીએબલને '''stud.''' ની જેમ ડીકલેર કયું છે. |
|- | |- | ||
| 04:09 | | 04:09 | ||
− | | | + | | અહી આપણે '''union''' વેરીએબલ નો ઉપયોગ કરીને '''union''' ના મેમ્બર્સને એક્સેસ કરી શકીએ છીએ: |
*'''stud dot english''' | *'''stud dot english''' | ||
Line 166: | Line 166: | ||
|- | |- | ||
|04:21 | |04:21 | ||
− | | | + | | પછી આપણે કુલ માર્ક્સની ગણતરી કરીશું અને તેને પ્રદશિત કરીશું. |
|- | |- | ||
| 04:26 | | 04:26 | ||
− | | | + | | ચાલો આને એક્ઝીક્યુટ કરીએ '''terminal''' પર ટાઈપ કરો , '''gcc space union dot c space hyphen o space union''' |
− | + | ટાઈપ કરો '''dot slash union''' | |
|- | |- | ||
|04:44 | |04:44 | ||
− | | | + | | આઉટપુટ : '''Total is 228''' દેખાડે છે. |
|- | |- | ||
| 04:50 | | 04:50 | ||
− | | | + | | ચાલો '''structure '''અને ''' union''' બંને વચ્ચે તફાવત જોઈએ. |
|- | |- | ||
| 04:55 | | 04:55 | ||
− | | '''Union''' | + | | '''Union''' તેના બધા મેમ્બરોમાટે સમાન સ્ટોરેજ સ્પેસ નિર્ધારિત કરે છે. |
|- | |- | ||
| 05:01 | | 05:01 | ||
− | | '''Structure''' | + | | '''Structure''' તેના બધા મેમ્બરોમાટે અલગ અલગ સ્ટોરેજ સ્પેસ નિર્ધારિત કરે છે. |
|- | |- | ||
| 05:07 | | 05:07 | ||
− | | '''Union''' | + | | '''Union''' ઓછી મેમરી સ્પેસને રોકે છે. |
|- | |- | ||
| 05:11 | | 05:11 | ||
− | | '''Structure''' | + | | '''Structure''' વધુ મેમરી સ્પેસને રોકે છે. |
|- | |- | ||
| 05:14 | | 05:14 | ||
− | | | + | | '''union:''' નો ઉદાહરણ છે. |
'''union student{int marks;<nowiki>char name[6];</nowiki>double average;};''' | '''union student{int marks;<nowiki>char name[6];</nowiki>double average;};''' | ||
|- | |- | ||
| 05:27 | | 05:27 | ||
− | | | + | | '''union''' વેરીએબલ ના માટે મેમેરી એલોકેશન''' 8 bytes.''' થશે. |
− | + | જેમકે '''double datatype''' વધુમાં વધુ મેમરી સ્પેસ ને રોકશે. | |
|- | |- |
Revision as of 16:01, 30 November 2015
|
|
---|---|
00:01 | C માં Typedef and Union પરના સ્પોકન ટ્યુટોરીયલમાં તમારું સ્વાગત છે. |
00:07 | આ ટ્યુટોરીયલ માં, આપણે શીખીશું,
અમુક ઉદાહરણ સાથે
|
00:17 | આ ટ્યુટોરીયલ માટે, હું ઉપયોગ કરી રહ્યી છું. Ubuntu Operating System version 11.10. gcc compiler version 4.6.1 on Ubuntu |
00:29 | આ ટ્યુટોરીયલનો અભ્યાસ કરવા માટે, તમે C ના ટ્યુટોરીયલ સાથે પરિચિત હોવા જોઈએ |
00:36 | જો નથી તો સંબંધિત ટ્યુટોરિયલ્સ માટે અમારી દેખાડેલ વેબસાઇટ જુઓ. |
00:43 | હું typedef keyword. ના પરિચય સાથે શરૂઆત કરું છું. |
00:49 | Typedef કીવર્ડ વર્તમાન type અથવા user-defined ડેટાટાઈપસ સાંકેતિક નામ આપવા માં મદદ કરે છે. |
00:58 | કમાંડને માટે alias (ઉપનામ) વ્યાખ્યિત કરવાનો એક માર્ગ છે. |
01:03 | આ કોડની સ્પષ્ટતા ને પૂરી પડવામાં મદદ કરે છે. |
01:07
આ કોડને સમઝવું અને બદલવાનું સહેલું કરે છે. | |
01:12 | સિન્ટેક્સ : typedef existing_name alias_name. ઉદાહરણ : typedef unsigned int uint; |
01:24 | ચાલો ઉદાહરણને કોડ આપીએ. |
01:28 | નોંધ લો કે આપની ફાઈલનું નામ pallindrome.c છે. |
01:34 | આ પ્રોગ્રામમાં આપણે તપાસીશું કે આપેલ નંબર pallindrome (પેલેનડ્રોમ) |
01:41 | કીવર્ડ નો ઉપયોગ કરીને unsigned int datatype ને uint ઉપનામ આપ્યું છે. |
01:52 | અહી આપણે વેરીએબલને ડીકલેર કરવા માટે uint નો ઉપયોગ કર્યો છે. |
01:59 | આ pallindrome ના માટે લોજીક છે. |
02:03 | હવે પ્રોગ્રામ એક્ઝીક્યુટ કરીએ. |
02:06 | ટર્મિનલ ખોલવા માટે કીબોર્ડ પર એક સાથે Ctrl+Alt+T કી દાબવો. |
02:16 | ટાઈપ કરો gcc space pallindrome dot c space hyphen o space pallindrome. Enter દબાવો. |
02:29 | ટાઈપ કરો : dot slash pallindrome |
02:34 | આપણે જોઈએ છીએ: Enter any three digit number |
02:38 | મેં 121 ઉમેરીશ. |
02:42 | આઉટપુટ છે : Given number is a palindrome number |
02:47 | Now we will learn about union datatype. |
02:52 | Union વિવિધ ડેટાટાઈપસ ને એક સાથે ગ્રુપ કરવા નું કલેક્શન છે. |
02:57 | Union તેના બધા મેમ્બરસ માટે એક સમાન સ્ટોરેજ સ્પેસ નિર્ધારિત કરે છે. |
03:03 | આપણે એક વખત માં યુનિયન ના એક જ મેમ્બર ને એક્સેસ કરી શકીએ છીએ. |
03:08 | સિન્ટેક્સ 1:
union union_nameછગડીયા કૌંસમાં members; છગડીયા કૌંસ પછી union_variable અને semi-colon. |
03:21 | આપણી પાસે વૈકલ્પિક સિન્ટેક્સ પણ છે .
સિન્ટેક્સ : union union_name છગડીયા કૌંસમાં members; છગડીયા કૌંસ પછી semi-colon union union_name union_variable; |
03:39 | ચાલો એક ઉદાહરણ જોઈએ. |
03:41 | મારી પાસે એક કોડ ફાઈલ છે ચાલો આને જોઈએ. |
03:47 | નોંધ લો કે આપણી ફાઈલનું નામ union dot c છે. |
03:52 | આપણે student. નામનું union ડીકલેર કર્યું છે. |
03:56 | અહી આપણી પાસે ત્રણ વેરીએબલસ છે english, maths અને science. |
04:02 | મેઈન ફન્કશન માં આપણે union વેરીએબલને stud. ની જેમ ડીકલેર કયું છે. |
04:09 | અહી આપણે union વેરીએબલ નો ઉપયોગ કરીને union ના મેમ્બર્સને એક્સેસ કરી શકીએ છીએ:
|
04:21 | પછી આપણે કુલ માર્ક્સની ગણતરી કરીશું અને તેને પ્રદશિત કરીશું. |
04:26 | ચાલો આને એક્ઝીક્યુટ કરીએ terminal પર ટાઈપ કરો , gcc space union dot c space hyphen o space union
ટાઈપ કરો dot slash union |
04:44 | આઉટપુટ : Total is 228 દેખાડે છે. |
04:50 | ચાલો structure અને union બંને વચ્ચે તફાવત જોઈએ. |
04:55 | Union તેના બધા મેમ્બરોમાટે સમાન સ્ટોરેજ સ્પેસ નિર્ધારિત કરે છે. |
05:01 | Structure તેના બધા મેમ્બરોમાટે અલગ અલગ સ્ટોરેજ સ્પેસ નિર્ધારિત કરે છે. |
05:07 | Union ઓછી મેમરી સ્પેસને રોકે છે. |
05:11 | Structure વધુ મેમરી સ્પેસને રોકે છે. |
05:14 | union: નો ઉદાહરણ છે.
union student{int marks;char name[6];double average;}; |
05:27 | union વેરીએબલ ના માટે મેમેરી એલોકેશન 8 bytes. થશે.
જેમકે double datatype વધુમાં વધુ મેમરી સ્પેસ ને રોકશે. |
05:39 | Exampls for structure:
struct student{int mark;char name[6];double average;}; |
05:48 | Memory allocation for structure variable will be: 2bytes+6bytes+8bytes =16bytes. |
06:00 | This brings us to the end of this tutorial. |
06:04 | Let us summarize. |
06:06 | In this tutorial we learnt,
|
06:14 | As an assignment, |
06:17 | Write a program to display records of an employee. |
06:21 | Like name, address, salary. |
06:25 | Define a union named employee. |
06:29 | Give an alias name as emp using typedef. |
06:35 | Watch the video available at the link shown below |
06:39 | It summarises the Spoken Tutorial project |
06:42 | If you do not have good bandwidth, you can download and watch it |
06:47 | The Spoken Tutorial Project Team , Conducts workshops using spoken tutorials |
06:53 | Gives certificates to those who pass an online test. For more details, please write to contact@spoken-tutorial.org |
07:04 | Spoken Tutorial Project is a part of the Talk to a Teacher project |
07:08 | It is supported by the National Mission on Education through ICT, MHRD, Government of India |
07:16 | More information on this Mission is available at: http://spoken-tutorial.org\NMEICT-Intro |
07:22 | This is Ashwini Patil from IIT Bombay.
Thank you for joining. |