dithph

Untitled

Mar 13th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int i, *p, a[5] = {24, 32, 81, 44, 23};
  8. p = &a[3];
  9.  
  10. for(i=0; i<5; i++){
  11. cout << "Nilai index ke-" << i << " dari a[" << i << "]" << " adalah " << a[i] << endl;
  12. }
  13.  
  14. cout << endl << "===> Untuk p=&a[3]" << endl;
  15. cout << "Alamat p : " << p << endl;
  16. cout << "Nilai p : " << *p << endl;
  17. cout << "Ampersand p : " << &p << endl;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment