Skip to content

Instantly share code, notes, and snippets.

@krofna
Created May 11, 2012 14:30
Show Gist options
  • Save krofna/2660068 to your computer and use it in GitHub Desktop.
Save krofna/2660068 to your computer and use it in GitHub Desktop.
#include <stdint.h>
#include <iostream>
struct Data
{
uint16_t A;
uint16_t B;
};
int main()
{
Data d;
d.A = 1; d.B = 2;
uint16_t* p = &d.A;
uint16_t* p2 = p;
std::cout << p << ": " << *p << std::endl; // Prints: 0030FB8C: 1
std::cout << ++p << ": " << *p << std::endl; // Prints: 0030FB8E: 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment