Skip to content

Instantly share code, notes, and snippets.

@krofna
Created May 12, 2012 17:45
Show Gist options
  • Save krofna/2667873 to your computer and use it in GitHub Desktop.
Save krofna/2667873 to your computer and use it in GitHub Desktop.
More pointer fun
#include <stdint.h>
#include <iostream>
struct Data
{
int16_t C;
int16_t A;
int16_t B;
};
int main()
{
Data d[2];
Data* p = &d[0];
std::cout << p << std::endl;
std::cout << ++p << std::endl;
std::cout << ++p << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment