Skip to content

Instantly share code, notes, and snippets.

@1995hnagamin
Created August 23, 2016 09:23
Show Gist options
  • Save 1995hnagamin/8164d68b350e62fb39be95c2ec58082a to your computer and use it in GitHub Desktop.
Save 1995hnagamin/8164d68b350e62fb39be95c2ec58082a to your computer and use it in GitHub Desktop.
int main() {
int i = 0;
int const ci = 0;
int * pi;
pi = &i;
// pi = &ci;
int const * pci;
pci = &i;
pci = &ci;
int * * ppi;
// ppi = &pci;
ppi = π
int const * * ppci;
// ppci = π
ppci = &pci;
int const * const * pcpci;
pcpci = π
pcpci = &pci;
return 0;
}
void func1() {
int i = 0;
int * pi1 = &i;
int const * pci = pi1;
// int * pi2 = pci;
}
void func2() {
int i = 0;
int * pi = &i;
int const * * ppci;
// ppci = π
int const ci = 0;
*ppci = &ci;
*pi = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment