Wrong size of Derived Class..?

Thank you so much.
Last edited on
When posting code, use code tags.
Don't post a bunch of irrelevant code. The following should show the same behavior:
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>

class MyClass{
   char c[10];
   int q;
};

int main(){
   std::cout << sizeof(MyClass);
   std::cin.get();
   return 0;
}


see this: http://en.wikipedia.org/wiki/Data_structure_alignment
Memory alignment isn't something you should be concerned with though.
Topic archived. No new replies allowed.