Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8361889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:48:28+00:00 2026-06-09T11:48:28+00:00

Let me more clear, I want to pad an internal structure how do I

  • 0

Let me more clear,
I want to pad an internal structure how do I do it..? Example-

where struct b is

struct b{
  u_int32_t aa;
  u_int32_t bb;
};

struct c{
  u_int64_t cc;
};

Now, my compiler is doing a padding of 8 byte between the struct b and c in struct d. So, how do i get rid of that?

Hope, it clear now. Can somebody give me a answer?

structure d{

struct b;

struct c; //I want to make this structure a padded one, how to go about it?

struct c;

}

Please, can somebody help me with this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:48:30+00:00Added an answer on June 9, 2026 at 11:48 am

    From the tags, I deduce you’re on linux. GCC recognizes the following attribute:

    __attribute__((packed))
    

    which you can write before or after the declaration of the struct to remove the padding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to let TextBox control TextChanged event fire only when there are more
Let's say I have 3 or more peers connected to the same WiFi Access
(if the question is more appropriate for RackOverflow please let me know) I've setup
Edit 2: Actually SomeEventHandler is more concise than OnSomeEventHandler : If I let Visual
back again with some more SQLAlchemy shenanigans. Let me step through this. My table
Can Permalink_fu combine 2 or more model attributes to create a unique permalink? Let's
I would like to make tab completion in bash a bit more intelligent. Let's
(Thanks in advance! Please let me know if you need more info. Sample code
Let's have an example like below: package xliiv.sandbox; import android.app.Activity; import android.os.Bundle; import android.util.Log;
Let's say I don't have photoshop, but I want to make pattern files (.pat)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.