Ask Your Question
4

Is it possible for C to insert padding between the members of a struct that have decreasing alignment?

asked 2023-03-25 11:00:00 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-12-27 22:00:00 +0000

ladyg gravatar image

Yes, it is possible for C to insert padding between the members of a struct that have decreasing alignment. This is because the C language standard allows compilers to insert padding within a struct to ensure proper alignment of its members, which can improve performance on some architectures. The specific amount and location of the padding inserted will depend on the compiler and architecture being used.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-03-25 11:00:00 +0000

Seen: 6 times

Last updated: Dec 27 '21