Union in C programming | Structure vs Union
HTML-код
- Опубликовано: 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 RUclips: / 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 🤩🤩🤩
Thanks sir your teaching method is very easy
Thank you so much sir helpful topic
bahut accha padhate ho sab samaj aa gya thank you
Thank you sir ✨
RUclips is a very nice platform ☺
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
Thankyou sir
sir which software you used in which you used white board
Thank you sir
Thanks sir its goes in my syllabus.
Nice sir
Great as Always 😎
Hiii
Tq Bro
Because of you I got good marks in RDBMS 🙂🙂🙂
Thanks a lot sir😊
Watching 2hr before exam
Great explain sir
❤❤
Sir Data structure & Algorithms Start
Make videos...🙏for competitive programing...✅🇮🇳
nice explanation
Superb sir
khush rahin sir !
Sir, ""System Analysis and Design(SAD)"" subject bhi padayo
Tq 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
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
Hello varun sir ..I want to learn python from you .plz tell me how is it possible??
What about nested structure
Wah sir you are great
best sir c programming ke or bhi video banana plz
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!?
Osam padh ho bhaiya g
sir machine learning pe bhi bnai hai aapne video
you look like bgmi punk
Sir... Please make video for python...
And your computer network and AI tutorial videos is superb 👍🏻
Sir C programming se direct Galaxy me chale gaye 🤣
But best explanation thank you Sir👌
baked bun
Wow! sir😍😍
Simply awesome......🙏
ex peecha hi nahi chodti. Padhne aya tha idhar bhi aa gai
First comment 🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳
Thank you for the video Varun sir 🥳🥳🥳🥳🥳🥳🥳
🤟🎯🤟
make videos on machine learning also
Sir AI ka complete syllabus krwa do
Sir please rajasthan computer instructor ki test series launch kro chapter wise questions k saath bohot jaada dimand hai
machine learning iss bar course me sir
You are getting hurry in every topic you need to work on some complicated problem sir
Channel band kar do
Bahut bekar padhate ho
Very bad video 👺👺👺👺👺👺👺👺👺👺👺👺
Thankyou sir
Sir one request please compiler playlist me runtime environment topic pe bhi ek vedio bana dijiye ....