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

ความคิดเห็น • 45

  • @ashishsingh7056
    @ashishsingh7056 5 ปีที่แล้ว +3

    Your are the best in the world sir

  • @Rajput_jayshreeRam
    @Rajput_jayshreeRam ปีที่แล้ว +8

    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

    • @Pazex96
      @Pazex96 ปีที่แล้ว

      Thanks Bhai yhi confusion tha Jai Sri Ram

    • @rajeevranjan9172
      @rajeevranjan9172 9 หลายเดือนก่อน

      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

  • @mcbotface
    @mcbotface 5 ปีที่แล้ว +3

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

  • @abhishekkumarrawat4294
    @abhishekkumarrawat4294 5 ปีที่แล้ว +1

    Yes sir please upload the data structure video

  • @abdelmoulaezzaouia8282
    @abdelmoulaezzaouia8282 3 ปีที่แล้ว

    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';

  • @andreiasimas2984
    @andreiasimas2984 3 หลายเดือนก่อน

    Thank you

  • @chic_koo
    @chic_koo 5 ปีที่แล้ว +2

    Please upload vedio of data structure in c also sir

  • @jamesroy9027
    @jamesroy9027 5 ปีที่แล้ว +3

    Sir Please complete DATA STRUCTURE as soon as posiblle

  • @mrunmaidahare8477
    @mrunmaidahare8477 3 ปีที่แล้ว +2

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

  • @GaryChike
    @GaryChike 6 หลายเดือนก่อน

    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`

  • @manojprabhakar1195
    @manojprabhakar1195 5 ปีที่แล้ว +1

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

  • @saddamahmad2310
    @saddamahmad2310 5 ปีที่แล้ว +1

    thank you very much sir for this video

  • @s.o.s6201
    @s.o.s6201 3 ปีที่แล้ว +2

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

  • @amanchaudhary8817
    @amanchaudhary8817 2 ปีที่แล้ว

    Very thank you sir 🙏🏼

  • @sunilpuse5828
    @sunilpuse5828 5 ปีที่แล้ว +4

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

  • @SSS-yi2jz
    @SSS-yi2jz 2 ปีที่แล้ว

    Thankyou

  • @learningisfun3791
    @learningisfun3791 4 ปีที่แล้ว

    Great explanation

  • @kunalsoni7681
    @kunalsoni7681 5 ปีที่แล้ว

    wow nice one presentation sir

  • @Ahmad-ej2fy
    @Ahmad-ej2fy 4 ปีที่แล้ว +4

    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]

    • @syedhazim3722
      @syedhazim3722 4 ปีที่แล้ว

      Concentrate on the question it says “ignoring alignment considerations”

    • @megha16_
      @megha16_ 4 ปีที่แล้ว

      Are padding concept toh use hi ni krna yha

    • @alikhaledabdulmonem1210
      @alikhaledabdulmonem1210 3 ปีที่แล้ว

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

    • @006daredevil
      @006daredevil 3 ปีที่แล้ว

      @@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

    • @s.o.s6201
      @s.o.s6201 3 ปีที่แล้ว

      cocaine or meth... :D

  • @uditnousran5959
    @uditnousran5959 4 ปีที่แล้ว +4

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

    • @lakshmiprasannachilukuri8814
      @lakshmiprasannachilukuri8814 3 ปีที่แล้ว +3

      Bcoz,in question it is already mentioned to ignore alignment consideration i.e.,padding

  • @shabeerkhan379
    @shabeerkhan379 5 ปีที่แล้ว

    Great tq🤝

  • @christopherhenry981
    @christopherhenry981 6 หลายเดือนก่อน

    Why u didn't used structure padding in this

  • @alikhaledabdulmonem1210
    @alikhaledabdulmonem1210 3 ปีที่แล้ว +4

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

    • @chakradharthota1100
      @chakradharthota1100 3 ปีที่แล้ว +1

      Can u tell me how it wil be 20 or 24 plz🙏

    • @006daredevil
      @006daredevil 3 ปีที่แล้ว +2

      @@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

    • @diveshsingla4564
      @diveshsingla4564 2 ปีที่แล้ว +1

      i also concluded it to 20, do you know why it is 18

  • @anushkagupta521
    @anushkagupta521 5 ปีที่แล้ว

    Please upload other videos

  • @AlokSingh-cb3fv
    @AlokSingh-cb3fv 5 ปีที่แล้ว

    Please uploads more videos

  • @nihalpandey5675
    @nihalpandey5675 4 ปีที่แล้ว +1

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

  • @ashishsingh7056
    @ashishsingh7056 5 ปีที่แล้ว

    Sir please upload vedio

  • @megha16_
    @megha16_ 4 ปีที่แล้ว +2

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

  • @abdelmoulaezzaouia8282
    @abdelmoulaezzaouia8282 3 ปีที่แล้ว

    I want to answer please

  • @ashishsingh7056
    @ashishsingh7056 5 ปีที่แล้ว

    Sir please

  • @onlynoone6512
    @onlynoone6512 2 ปีที่แล้ว

    I got 24🤦‍♂🤦‍♂🤦‍♂🤦‍♂

  • @ElifArslan-l9g
    @ElifArslan-l9g 3 ปีที่แล้ว

    thank you