Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int i, *p, a[5] = {24, 32, 81, 44, 23};
- p = &a[3];
- for(i=0; i<5; i++){
- cout << "Nilai index ke-" << i << " dari a[" << i << "]" << " adalah " << a[i] << endl;
- }
- cout << endl << "===> Untuk p=&a[3]" << endl;
- cout << "Alamat p : " << p << endl;
- cout << "Nilai p : " << *p << endl;
- cout << "Ampersand p : " << &p << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment