gpsgiraldi

2024_ponteiros_lista_ex7

Jun 29th, 2024 (edited)
734
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | Source Code | 0 0
  1. /******************************************************************************
  2. 2 – Qual a saída do programa abaixo, sabendo-se que i ocupa
  3. o endereço 3050 na memória?
  4. *******************************************************************************/
  5. #include <stdio.h>
  6.  
  7. int main()
  8. {
  9.  
  10.     int i=5, *p;
  11.     p = &i;//endereço de i equivale a 3050
  12.     printf("%p %i %i \n", p,*p,*p+2);//saída: 3050 5 7
  13.  
  14.     return 0;
  15. }
Advertisement
Comments
  • gpsgiraldi
    1 year (edited)
    # text 0.11 KB | 0 0
    1. Ajuda observar que a saída está especificada %p %i %i então os valores a sair serão "ENDEREÇO INTEIRO INTEIRO"
Add Comment
Please, Sign In to add comment