contoh script c++ pointer

contoh script c++ pointer

#include<iostream>

#include<cstdlib>

using namespace std;

int main()

{

int x;

int *px;

x=2;

px=&x;//membaca alamat dari x

cout<<"Nilai x.......... : "<<x<<endl;

cout<<"Nilai *px.......... : "<<x<<endl;

cout<<"Nilai px (alamat x).......... : "<<px<<endl;

system("PAUSE");

return 0;

}

Share this:

Enter your email address to get update from Kompi Ajaib.

Tidak ada komentar