Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Created August 13, 2012 18:31
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 mitsuhiko/3343011 to your computer and use it in GitHub Desktop.
Save mitsuhiko/3343011 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main()
{
struct F {
int x;
} foo, *foo_ptr = &foo;
int F::*x = &F::x;
foo.*x = 42;
printf("%d\n", foo_ptr->*x);
}
@twneale
Copy link

twneale commented Aug 13, 2012

.......why?

@mitsuhiko
Copy link
Author

Why not? I can see uses for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment