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

Комментарии • 70

  • @anjalimeena3006
    @anjalimeena3006 Год назад +54

    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 :)

  • @poojapoojadhapte1430
    @poojapoojadhapte1430 Год назад +8

    Thankyou because of u all topic clear dont stop doing urs all subjects are beautiful

  • @rupesh_gamer
    @rupesh_gamer Год назад +4

    thanks sir for everything
    im watching your every videos Thanks for this content 🤩🤩🤩

  • @gajananandurkar3445
    @gajananandurkar3445 Год назад

    Thanks sir your teaching method is very easy

  • @binusahu95
    @binusahu95 6 месяцев назад

    Thank you so much sir helpful topic

  • @Harshit_patel513
    @Harshit_patel513 Месяц назад

    bahut accha padhate ho sab samaj aa gya thank you

  • @komalchaudhary3424
    @komalchaudhary3424 Год назад +1

    Thank you sir ✨

  • @amaanalikhan9450
    @amaanalikhan9450 Год назад

    RUclips is a very nice platform ☺

  • @rohitthakur6397
    @rohitthakur6397 Год назад +9

    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.

    • @karanshrivastava3086
      @karanshrivastava3086 Год назад +1

      Inka mtlb hai ki one member can contain a value at a given time

  • @sushildwivedi4289
    @sushildwivedi4289 5 месяцев назад +1

    Thankyou sir

  • @shahrozkidunia3685
    @shahrozkidunia3685 10 месяцев назад

    sir which software you used in which you used white board

  • @kyakrogejaank4137
    @kyakrogejaank4137 Месяц назад

    Thank you sir

  • @amaanalikhan9450
    @amaanalikhan9450 Год назад +2

    Thanks sir its goes in my syllabus.

  • @Imrankhan8bp
    @Imrankhan8bp 8 месяцев назад

    Nice sir

  • @Tamanna_K_Hardy
    @Tamanna_K_Hardy 2 года назад +9

    Great as Always 😎

  • @pandayalachandrashekar4678
    @pandayalachandrashekar4678 2 года назад +4

    Tq Bro
    Because of you I got good marks in RDBMS 🙂🙂🙂

  • @aditinageshwar3217
    @aditinageshwar3217 Год назад +1

    Thanks a lot sir😊

  • @Piyush_sahu.1
    @Piyush_sahu.1 5 месяцев назад +2

    Watching 2hr before exam

  • @amitgoswami7856
    @amitgoswami7856 2 года назад

    Great explain sir

  • @user-zv7kj6ht8u
    @user-zv7kj6ht8u 6 месяцев назад

    ❤❤

  • @rajanmodanwal7479
    @rajanmodanwal7479 2 года назад +2

    Sir Data structure & Algorithms Start
    Make videos...🙏for competitive programing...✅🇮🇳

  • @swatiyadav3993
    @swatiyadav3993 2 года назад

    nice explanation

  • @harish9490
    @harish9490 2 года назад

    Superb sir

  • @lalianschool6806
    @lalianschool6806 2 года назад

    khush rahin sir !

  • @hirenmeghnani
    @hirenmeghnani 2 года назад +1

    Sir, ""System Analysis and Design(SAD)"" subject bhi padayo

  • @Ravina-gl4od
    @Ravina-gl4od 9 месяцев назад

    Tq sir

  • @priyankashukla9945
    @priyankashukla9945 2 года назад

    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

  • @TheMR-777
    @TheMR-777 2 года назад +3

    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

  • @nidhisharma6539
    @nidhisharma6539 2 года назад

    Hello varun sir ..I want to learn python from you .plz tell me how is it possible??

  • @mohammediuzrakhanum91
    @mohammediuzrakhanum91 Год назад

    What about nested structure

  • @sscode3809
    @sscode3809 2 года назад

    Wah sir you are great

  • @mr.rameshbhaiapatelfitter2299
    @mr.rameshbhaiapatelfitter2299 2 года назад

    best sir c programming ke or bhi video banana plz

  • @souvikmajumdar9090
    @souvikmajumdar9090 Год назад +1

    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!?

  • @kallugaming1k
    @kallugaming1k Год назад

    Osam padh ho bhaiya g

  • @__Uv09
    @__Uv09 2 года назад

    sir machine learning pe bhi bnai hai aapne video

  • @milindthakare1648
    @milindthakare1648 Год назад +1

    you look like bgmi punk

  • @dikshakumari382
    @dikshakumari382 2 года назад +2

    Sir... Please make video for python...
    And your computer network and AI tutorial videos is superb 👍🏻

  • @vinushisoni4773
    @vinushisoni4773 Год назад +3

    Sir C programming se direct Galaxy me chale gaye 🤣
    But best explanation thank you Sir👌

  • @sarastemkar7835
    @sarastemkar7835 Год назад

    baked bun

  • @prathasaxena9474
    @prathasaxena9474 2 года назад

    Wow! sir😍😍
    Simply awesome......🙏

  • @DhruvKumar-dikito
    @DhruvKumar-dikito 10 месяцев назад

    ex peecha hi nahi chodti. Padhne aya tha idhar bhi aa gai

  • @chikkii1601
    @chikkii1601 2 года назад +2

    First comment 🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳
    Thank you for the video Varun sir 🥳🥳🥳🥳🥳🥳🥳

  • @Eclipso619
    @Eclipso619 2 года назад +4

    🤟🎯🤟

  • @asutoshdoppalapudi7830
    @asutoshdoppalapudi7830 2 года назад

    make videos on machine learning also

  • @muhammadafzal8329
    @muhammadafzal8329 2 года назад

    Sir AI ka complete syllabus krwa do

  • @shivam2246
    @shivam2246 2 года назад

    Sir please rajasthan computer instructor ki test series launch kro chapter wise questions k saath bohot jaada dimand hai

  • @__Uv09
    @__Uv09 2 года назад

    machine learning iss bar course me sir

  • @user-hf4be1ty2s
    @user-hf4be1ty2s 5 месяцев назад

    You are getting hurry in every topic you need to work on some complicated problem sir

  • @a2thegenius343
    @a2thegenius343 2 года назад +3

    Channel band kar do
    Bahut bekar padhate ho

  • @sachinmaurya4869
    @sachinmaurya4869 3 месяца назад +1

    Very bad video 👺👺👺👺👺👺👺👺👺👺👺👺

  • @LORDSMOBILE108
    @LORDSMOBILE108 Месяц назад

    Thankyou sir

  • @jyotiyadav3153
    @jyotiyadav3153 2 года назад

    Sir one request please compiler playlist me runtime environment topic pe bhi ek vedio bana dijiye ....