Unions in C (Solved Problem 1)

preview_player
Показать описание
C Programming: Solved Question on Unions in C Programming.
Topics discussed:
1) GATE CS 2000 solved question on Unions.

Music:
Axol x Alex Skrindo - You [NCS Release]

#CProgrammingByNeso #CProgramming #UnionsInC #Structure&Union
Рекомендации по теме
Комментарии
Автор

The answer is according to 16bit operating system
But if the system is 32 bit so answer would be 20 and of the system is working on 64 bit like vscode, gdb etc the answer would be 24 .you can check it out

Rajput_jayshreeRam
Автор

To disregard 'alignment/padding' and to obtain the same answer as the instructor, use these flags:
GCC: `-fpack-struct`
Clang: `-fpack-struct=1`

or surround code with:
`pragma pack(1) // disable padding`
`pragma pack() // enable padding`

GaryChike
Автор

Fill in the blanks to declare a union holding an integer, a float and a char. Then, declare a union variable and initialize its char member.
union
values {

int i_val;

float f_val;

char c_val;

};



union
val;

val
.c_val = 'a';

abdelmoulaezzaouia
Автор

Yes sir please upload the data structure video

abhishekkumarrawat
Автор

what about structure padding? here? didn't consider structure padding??

mrunmaidahare
Автор

Upload videos on Linked Lists and Circular Priority Queues using dynamic memory allocation.

mcbotface
Автор

Sir Please complete DATA STRUCTURE as soon as posiblle

jamesroy
Автор

thank you very much sir for this video

saddamahmad
Автор

Please upload vedio of data structure in c also sir

chic_koo
Автор

the hardest part here was to make out what is alignment consideration.... :))

s.o.s
Автор

Continue ur videos..i m on 45no..😊
Hope i will be a good prommer caz of u 😍

sunilpuse
Автор

sirr.. post videos on dynamic memory allocations as well as command line argumnents

manojprabhakar
Автор

what is about the concept of padding? this struct should have then in a 32-bit architecture the size of 20 bite [ 10 bits+ 2bits(padding) +8bits]

Ahmad-ejfy
Автор

Why didn’t we consider padding concept in this question sir??

uditnousran
Автор

Why u didn't used structure padding in this

christopherhenry
Автор

Yeaahhh😍 my answer had also come 18, when i paused the video.

megha_
Автор

Sir what would we write if we have to access y i am not sure will it be t. (u.y) ?

nihalpandey
Автор

if we took padding into consideration then the answer should be 20 or 24 ?

alikhaledabdulmonem