Selasa, 28 Juli 2015

Program Menampilkan Alamat (Penggunaan Pointer)

#include<stdio.h>
#include<iostream>
using namespace std;
main()
{
long b;
printf("Masukkan Batas = "); scanf("%d",&b);
long in[b], *inp;

for(int i=1; i<=b; i++)
{
inp=&in[i];
printf("Masukkan Angka Ke - %d = ",i);
cin>>*inp;
*++inp;
}
printf("\n\n");
for(int i=1; i<=b; i++)
{
inp=&in[i];
printf("%d \t",in[i]);
cout<<inp;
printf("\t %x \t\n",inp);
*++inp;
}

printf("\nOhansyah\t 2014141384 \t\t02TPLMA\n");
return 0;
}

Share:

0 komentar:

Posting Komentar

index

Popular Posts