Skip to content

Instantly share code, notes, and snippets.

@renatoargh
Created July 26, 2012 22:59
Show Gist options
  • Save renatoargh/3185124 to your computer and use it in GitHub Desktop.
Save renatoargh/3185124 to your computer and use it in GitHub Desktop.
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