Structure and Union

Discussion in 'C Programming' started by Sami A. Shabah, May 16, 2010.

  1. Hi,
    I'm a student of Mechanical Engineering at IUT. I have the following
    question:

    What is the basic difference between Structure and Union?

    Any reply will be appreciated.

    Sami a. Shabah
    MCE,IUT,St. no:091402
    Sami A. Shabah, May 16, 2010
    #1
    1. Advertising

  2. Sami A. Shabah

    Guest

    The comp.lang.c Oracle has pondered your question deeply.

    The question was:
    > What is the basic difference between Structure and Union?


    And thus spake the Oracle:

    A structure is a type consisting of a sequence of members whose
    storage is allocated in an ordered sequence, and a union is a type
    consisting of a sequence of members whose storage overlap.

    You owe the Oracle an explanation of why interviewers ask what
    encapsulation means.

    Gregory Pietsch
    , May 21, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt Garman
    Replies:
    1
    Views:
    649
    Matt Garman
    Apr 25, 2004
  2. Peter Dunker

    union in struct without union name

    Peter Dunker, Apr 26, 2004, in forum: C Programming
    Replies:
    2
    Views:
    852
    Chris Torek
    Apr 26, 2004
  3. xmllmx
    Replies:
    5
    Views:
    575
    Gianni Mariani
    Aug 26, 2007
  4. manish sahu
    Replies:
    5
    Views:
    5,164
    James Kanze
    Feb 14, 2008
  5. Tagore

    structure and union queries

    Tagore, Apr 7, 2009, in forum: C Programming
    Replies:
    37
    Views:
    1,081
    Ben Bacarisse
    Apr 13, 2009
Loading...

Share This Page