contoh program pointer c++

Contoh Program C++ Pointer
#include  <stdio.h>

int main(void)
{

  int    x;
  int   *y;  

  printf("masukkan nilai untuk x : ");
  scanf("%d",&x);
  printf("x: %d\n",x);
  printf("Alamat x : %p\n",&x);
  printf("alamat x dimasukkan ke >> y\n");
  y=&x;
  printf("y berisi alamat : %p\n",y);
  printf("isi y : %d",*y);
}

0 komentar:

Post a Comment

Copyright © 2014 Dunia Naeta All Right Reserved