Unions in C (Solved Problem 1)
ฝัง
- เผยแพร่เมื่อ 18 ต.ค. 2024
- C Programming: Solved Question on Unions in C Programming.
Topics discussed:
1) GATE CS 2000 solved question on Unions.
C Programming Lectures: goo.gl/7Eh2SS
Follow Neso Academy on Instagram: @nesoacademy(bit.ly/2XP63OE)
Follow me on Instagram: @jaspreetedu(bit.ly/2YX26E5)
Contribute: www.nesoacademy...
Memberships: bit.ly/2U7YSPI
Books: www.nesoacademy...
Website ► www.nesoacademy...
Forum ► forum.nesoacade...
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
#CProgrammingByNeso #CProgramming #UnionsInC #Structure&Union
Your are the best in the world sir
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
Thanks Bhai yhi confusion tha Jai Sri Ram
yae he has already mentioned the same thing few lectures back , jaspreet sir has mentioned each and every minute details about the topic , and that is his beauty
Upload videos on Linked Lists and Circular Priority Queues using dynamic memory allocation.
Yes sir please upload the data structure video
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';
Thank you
Please upload vedio of data structure in c also sir
Sir Please complete DATA STRUCTURE as soon as posiblle
what about structure padding? here? didn't consider structure padding??
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`
sirr.. post videos on dynamic memory allocations as well as command line argumnents
thank you very much sir for this video
the hardest part here was to make out what is alignment consideration.... :))
Very thank you sir 🙏🏼
Continue ur videos..i m on 45no..😊
Hope i will be a good prommer caz of u 😍
Going with your spellings you should learn python
Thankyou
Great explanation
wow nice one presentation sir
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]
Concentrate on the question it says “ignoring alignment considerations”
Are padding concept toh use hi ni krna yha
if we took padding into consideration then the answer should be 20 or 24 ?
@@alikhaledabdulmonem1210 for 32 bits architecture 1 word is 4 bytes so 4 + 4 + 4(includes 2 bytes empty space) = 12 bytes for structure
and 4 + 4 = 8 bytes for union total 12 + 8 = 20 bytes
cocaine or meth... :D
Why didn’t we consider padding concept in this question sir??
Bcoz,in question it is already mentioned to ignore alignment consideration i.e.,padding
Great tq🤝
Why u didn't used structure padding in this
if we took padding into consideration then the answer should be 20 or 24 ?
Can u tell me how it wil be 20 or 24 plz🙏
@@chakradharthota1100 for 32 bits architecture 1 word is 4 bytes so 4 + 4 + 4(includes 2 bytes empty space) = 12 bytes for structure
and 4 + 4 = 8 bytes for union total 12 + 8 = 20 bytes
i also concluded it to 20, do you know why it is 18
Please upload other videos
Please uploads more videos
Sir what would we write if we have to access y i am not sure will it be t. (u.y) ?
Is it working, bro?
Sir please upload vedio
Yeaahhh😍 my answer had also come 18, when i paused the video.
I want to answer please
Sir please
I got 24🤦♂🤦♂🤦♂🤦♂
thank you