Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 38

For questions about the implementation or design of data structures as specifically relevant to programming language design or implementation. Generic data structure questions are off-topic.

8 votes
7 answers
2k views

Distinguishing classes from structures

Some languages have a concept of classes separately than structs. In C++ the only difference is whether the members are public or private by default. This seems redundant. Why have a separate class ke …
CPlus's user avatar
  • 9,143
8 votes
9 answers
1k views

Would a structure ever require padding beyond what is required to align the members?

In C a structure can have an arbitrary amount of padding. In theory this implementation conforms to the C standard: struct X { int x; // 1000000000 bytes padding }; // sizeof(struct X) == 1000 …
CPlus's user avatar
  • 9,143
8 votes
7 answers
1k views

What are the implications of a 'packed' keyword/feature?

I am bothered by the fact that, in C, struct types can be arbitrarily large. We have no control over their memory layout except for the fact that the first member is always at the beginning of the mem …
CPlus's user avatar
  • 9,143