Home » , , » contoh script c++ pointer2

contoh script c++ pointer2

#include<cstdlib>
#include<iostream>
using namespace std;
int main()
{
int x[10]={0,1,2,3,4,5,6,7,8,9};
int *px;
int i;
for(i=0;i<10;i++)
{
px=&x[i]; //membaca alamat dari x
cout<<x[i]<<" "<<*px<<" "<<px<<endl;
}
system("PAUSE");
return 0;
}

0 komentar:

Posting Komentar