Advertisement
vaulttech

Ponteiros - exemplo4

Mar 25th, 2011
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. // Exemplo de passagem de parâmetro por valor
  2.  
  3. int main ()
  4. {
  5.     int meu_int = 10;
  6.    
  7.     // chamo a função passando a variável. Ela fica com preguiça, não vai,
  8.     // e manda um clone, que é alterado no seu lugar, mantendo a "meu_int"
  9.     // original intacta.
  10.     incrementa (meu_int);
  11.  
  12.     printf("meu_int: %d \n", meu_int);  //--> imprimirá meu_int: 10
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement