1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What is the concept of padding?

Discussion in 'C' started by Kailash, Nov 20, 2007.

  1. Kailash

    Kailash New Member

    Joined:
    Jul 24, 2007
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Can any one tell what is the concept of padding in c and c++.

    and how much space following user defined variable will take:
    Code:
    
    struct num
    {
    int n;
    char ch;
    int p;
    }
    
    struct num
    {
    int n;
    int p;
    char ch;
    }
    
    struct num
    {
    char ch;
    int n;
    int p;
    }
    also tell me how the concept of padding is applying in these cases.
     
    Last edited by a moderator: Nov 20, 2007
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83

Share This Page