#include <stdio.h>
int main() {
int i = 5;
int *p = &i;
printf("%u\n", p
); //é o endereço de i printf("%d\n", *p
); //é o valor de i obtido pelo endereço que está em p printf("%d\n", (*p
) + 2); //pega o valor de i e soma 2 printf("%d\n", (&p
)); //pega o endereço de p printf("%d\n", (*(&p
))); //com o endereço de p pega o valor dele, que é o endereço de i printf("%d\n", *(*(&p
))); //então pega o valor de i, isto é o mesmo que *p printf("%d\n", 3 * (*p
)); //multiplica 3 pelo valor de i, é o mesmo que 3 * i printf("%d\n", *(*(&p
)) + 4); //soma 4 em i através de uma fórmula desnecessária }
//https://pt.stackoverflow.com/q/247773/101
I2luY2x1ZGUgPHN0ZGlvLmg+CiAKaW50IG1haW4oKSB7CiAgICBpbnQgaSA9IDU7CiAgICBpbnQgKnAgPSAmaTsKICAgIHByaW50ZigiJXVcbiIsIHApOyAgLy/DqSBvIGVuZGVyZcOnbyBkZSBpCiAgICBwcmludGYoIiVkXG4iLCAqcCk7ICAvL8OpIG8gdmFsb3IgZGUgaSBvYnRpZG8gcGVsbyBlbmRlcmXDp28gcXVlIGVzdMOhIGVtIHAKICAgIHByaW50ZigiJWRcbiIsICgqcCkgKyAyKTsgLy9wZWdhIG8gdmFsb3IgZGUgaSBlIHNvbWEgMgogICAgcHJpbnRmKCIlZFxuIiwgKCZwKSk7ICAvL3BlZ2EgbyBlbmRlcmXDp28gZGUgcAogICAgcHJpbnRmKCIlZFxuIiwgKCooJnApKSk7IC8vY29tIG8gZW5kZXJlw6dvIGRlIHAgcGVnYSBvIHZhbG9yIGRlbGUsIHF1ZSDDqSBvIGVuZGVyZcOnbyBkZSBpCiAgICBwcmludGYoIiVkXG4iLCAqKCooJnApKSk7IC8vZW50w6NvIHBlZ2EgbyB2YWxvciBkZSBpLCBpc3RvIMOpIG8gbWVzbW8gcXVlICpwCiAgICBwcmludGYoIiVkXG4iLCAzICogKCpwKSk7IC8vbXVsdGlwbGljYSAzIHBlbG8gdmFsb3IgZGUgaSwgw6kgbyBtZXNtbyBxdWUgMyAqIGkKICAgIHByaW50ZigiJWRcbiIsICooKigmcCkpICsgNCk7ICAvL3NvbWEgNCBlbSBpIGF0cmF2w6lzIGRlIHVtYSBmw7NybXVsYSBkZXNuZWNlc3PDoXJpYQp9CgovL2h0dHBzOi8vcHQuc3RhY2tvdmVyZmxvdy5jb20vcS8yNDc3NzMvMTAx