Skip to content

Instantly share code, notes, and snippets.

@mortenpi
Created April 30, 2014 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mortenpi/21f20279a554ed94d776 to your computer and use it in GitHub Desktop.
Save mortenpi/21f20279a554ed94d776 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
struct type_t {
int i;
};
void function()
{
cout << sizeof(type_t::i) << endl;
}
struct A {
A();
};
A::A()
{
cout << sizeof(type_t::i) << endl;
}
int main(int argc, char * argv[])
{
cout << sizeof(type_t::i) << endl;
function();
A a;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment