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;

}

Share this:

Enter your email address to get update from Kompi Ajaib.

Tidak ada komentar