Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MatrixManAtYrService/66d0e1ad6c2c5b24ca672df64c5579a4 to your computer and use it in GitHub Desktop.
Save MatrixManAtYrService/66d0e1ad6c2c5b24ca672df64c5579a4 to your computer and use it in GitHub Desktop.
    int foo[] = {1,2};   // an array of int
    char bar[] = "ab";   // an array of char
    void* baz = foo;   // a pointer to the first element of foo
    cout << *(baz++);    // you might think that this would print the second element of foo
    void* qux = bar; // a pointer to the first element of bar
    cout << *(qux++);    // you might think that this would print the second element of bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment