OPERATOR POINTER(& dan *)
#include<iostream>
#include<conio>
main()
{
int number=20;
int*numberptr;
numberptr=&number;
cout<<"number="<<*numberptr<<endl;
cout<<"number="<< numberptr;
cout<<"number="<< number;
getch();
}
eksekusi:
number=20
number=0x0012ff50
number=20
#include<conio>
main()
{
int number=20;
int*numberptr;
numberptr=&number;
cout<<"number="<<*numberptr<<endl;
cout<<"number="<< numberptr;
cout<<"number="<< number;
getch();
}
eksekusi:
number=20
number=0x0012ff50
number=20
Komentar
Posting Komentar