Unions in C (Solved Problem 1)

Поделиться
HTML-код
  • Опубликовано: 23 сен 2019
  • 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.org/donate
    Memberships: bit.ly/2U7YSPI
    Books: www.nesoacademy.org/recommende...
    Website ► www.nesoacademy.org/
    Forum ► forum.nesoacademy.org/
    Facebook ► goo.gl/Nt0PmB
    Twitter ► / nesoacademy
    Music:
    Axol x Alex Skrindo - You [NCS Release]
    #CProgrammingByNeso #CProgramming #UnionsInC #Structure&Union

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

  • @ashishsingh7056
    @ashishsingh7056 4 года назад +3

    Your are the best in the world sir

  • @saddamahmad2310
    @saddamahmad2310 4 года назад +1

    thank you very much sir for this video

  • @abhishekkumarrawat4294
    @abhishekkumarrawat4294 4 года назад +1

    Yes sir please upload the data structure video

  • @kunalsoni7681
    @kunalsoni7681 4 года назад

    wow nice one presentation sir

  • @learningisfun3791
    @learningisfun3791 3 года назад

    Great explanation

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

    Very thank you sir 🙏🏼

  • @mcbotface
    @mcbotface 4 года назад +3

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

  • @manojprabhakar1195
    @manojprabhakar1195 4 года назад +1

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

  • @Rajput_jayshreeRam
    @Rajput_jayshreeRam Год назад +5

    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 8 месяцев назад

      Thanks Bhai yhi confusion tha Jai Sri Ram

    • @rajeevranjan9172
      @rajeevranjan9172 4 месяца назад

      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

  • @shabeerkhan379
    @shabeerkhan379 4 года назад

    Great tq🤝

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

    Please upload vedio of data structure in c also sir

  • @user-bu8mg7uq3s
    @user-bu8mg7uq3s 3 года назад

    thank you

  • @SSS-yi2jz
    @SSS-yi2jz 2 года назад

    Thankyou

  • @jamesroy9027
    @jamesroy9027 4 года назад +3

    Sir Please complete DATA STRUCTURE as soon as posiblle

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

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

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

  • @sunilpuse5828
    @sunilpuse5828 4 года назад +4

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

  • @AlokSingh-cb3fv
    @AlokSingh-cb3fv 4 года назад

    Please uploads more videos

  • @s.o.s6201
    @s.o.s6201 2 года назад +2

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

  • @anushkagupta521
    @anushkagupta521 4 года назад

    Please upload other videos

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

    Why u didn't used structure padding in this

  • @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) ?

  • @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_ 3 года назад

      Are padding concept toh use hi ni krna yha

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

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

    • @006daredevil
      @006daredevil 2 года назад

      @@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 2 года назад

      cocaine or meth... :D

  • @GaryChike
    @GaryChike 2 месяца назад

    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`

  • @uditnousran5959
    @uditnousran5959 4 года назад +4

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

  • @ashishsingh7056
    @ashishsingh7056 4 года назад

    Sir please upload vedio

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

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

  • @ashishsingh7056
    @ashishsingh7056 4 года назад

    Sir please

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

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

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

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

    • @006daredevil
      @006daredevil 2 года назад +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

  • @abdelmoulaezzaouia8282
    @abdelmoulaezzaouia8282 3 года назад

    I want to answer please

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

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