Created
July 26, 2012 22:59
-
-
Save renatoargh/3185124 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void alterarValor(int x){ | |
x = x + 2; | |
} | |
int main(){ | |
int x = 4;//x esta armazenada na seção `stack` | |
printf("x está armazenada em %p \n\n", &x); | |
//x está armazenada em 0x7fff69032c24 | |
printf("Valor inicial de x: %i", x); | |
alterarValor(x); | |
printf("Valor de x: %i >>> não foi alterado!!!", x); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment