Union in C programming | Structure vs Union
Вставка
- Опубліковано 6 кві 2022
- 👉Subscribe to our new channel: / @varunainashots
A union is a user-defined type similar to structs in C except for one key difference. Structures allocate enough space to store all their members, whereas unions can only hold one member value at a time.
► Programming in C (Complete Playlist):
• C Programming
Other subject-wise playlist Links:
--------------------------------------------------------------------------------------------------------------------------------------
►Design and Analysis of algorithms (DAA):
• Design and Analysis of...
►Database Management System:
• DBMS (Database Managem...
► Theory of Computation
• TOC(Theory of Computat...
►Artificial Intelligence:
• Artificial Intelligenc...
►Computer Networks (Complete Playlist):
• Computer Networks (Com...
►Operating System:
• Operating System (Comp...
►Structured Query Language (SQL):
• Structured Query Langu...
►Discrete Mathematics:
• Discrete Mathematics
►Compiler Design:
• Compiler Design (Compl...
►Number System:
• Number system
►Cloud Computing & BIG Data:
• Cloud Computing & BIG ...
►Software Engineering:
• Software Engineering
►Data Structure:
• Data Structure
►Computer Architecture :
• Computer Organization ...
►Graph Theory (Complete Playlist):
• Graph Theory
►Digital Logic:
• Digital Logic (Complet...
---------------------------------------------------------------------------------------------------------------------------------------
Our social media Links:
► Subscribe to us on UA-cam: / gatesmashers
►Subscribe to our new channel: / @varunainashots
► Like our page on Facebook: / gatesmashers
► Follow us on Instagram: / gate.smashers
► Follow us on Instagram: / varunainashots
► Follow us on Telegram: t.me/gatesmashersofficial
► Follow us on Threads: www.threads.net/@gate.smashers
--------------------------------------------------------------------------------------------------------------------------------------
►For Any Query, Suggestion or notes contribution:
Email us at: gatesmashers2018@gmail.com
I used to watch your videos during clg, today i watched your video again for an interview preparation. It reminded me of those clg days and i used to watch your videos day and night before exam. You're doing great job sir :)
placement ho gaya kya?
@@sam-001 hogya tha
@@anjalimeena3006 konsi University se or kitne lpa ka
Kose clg se kiya ha apne
@@SakshamSharma_129 NSIT,Delhi
Thankyou because of u all topic clear dont stop doing urs all subjects are beautiful
thanks sir for everything
im watching your every videos Thanks for this content 🤩🤩🤩
Thank you sir ✨
Thank you so much sir helpful topic
Thanks sir your teaching method is very easy
Thankyou sir
UA-cam is a very nice platform ☺
Thank you sir
If we have to use only the largest memory's variable, then why we are declaring the other variables, with small data types in Union? We can declare just one variable with maximum data type.
Inka mtlb hai ki one member can contain a value at a given time
bahut accha padhate ho sab samaj aa gya thank you
sir which software you used in which you used white board
Tq Bro
Because of you I got good marks in RDBMS 🙂🙂🙂
Nice sir
Great as Always 😎
Hiii
Watching 2hr before exam
Thanks sir its goes in my syllabus.
Thanks a lot sir😊
❤❤
Great explain sir
Sir Data structure & Algorithms Start
Make videos...🙏for competitive programing...✅🇮🇳
Superb sir
Tq sir
khush rahin sir !
Well, you said that, to store a distance of “High Variability”, we use Union. But, in reality, you can simply use a double, for Decimal as well as Integer values, or unsigned double if you want more storage. That's not a problem, and that's not actually where it's used.
Union is strongly related to type punning (type-casting). If you want to read a variable of Type: A, as Type: B, (without copying) we can use either of following methods:
- *(B*)(&A)
- or, by using a union
Union is most commonly used in Polymorphism. Where, an Object can act as a Base (primitive) Object, or a Derived (primitive) Object. Like, reading integer as double, or reading float as long etc.
Edit: Corrected Wording
nice explanation
Wah sir you are great
What about nested structure
Sir, ""System Analysis and Design(SAD)"" subject bhi padayo
you look like bgmi punk
Osam padh ho bhaiya g
Hello varun sir ..I want to learn python from you .plz tell me how is it possible??
Sir C programming se direct Galaxy me chale gaye 🤣
But best explanation thank you Sir👌
Which of the following terms is just the collection of network that can be joined together ? Sir Iska answer kya h plzbata dijiye internet intranet extranet ...me kya ans sahi he...sab jagah different de rakha h
best sir c programming ke or bhi video banana plz
baked bun
Sir... Please make video for python...
And your computer network and AI tutorial videos is superb 👍🏻
Instead of writing g so many variable in union why can't we just take "double data type" to define the size? What is the reason behind taking all the data type and the size of the biggest data type get's the priority!?
ex peecha hi nahi chodti. Padhne aya tha idhar bhi aa gai
Wow! sir😍😍
Simply awesome......🙏
First comment 🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳
Thank you for the video Varun sir 🥳🥳🥳🥳🥳🥳🥳
🤟🎯🤟
sir machine learning pe bhi bnai hai aapne video
Sir please rajasthan computer instructor ki test series launch kro chapter wise questions k saath bohot jaada dimand hai
make videos on machine learning also
Sir AI ka complete syllabus krwa do
machine learning iss bar course me sir
You are getting hurry in every topic you need to work on some complicated problem sir
Very bad video 👺👺👺👺👺👺👺👺👺👺👺👺
Channel band kar do
Bahut bekar padhate ho
Thankyou sir
Sir one request please compiler playlist me runtime environment topic pe bhi ek vedio bana dijiye ....