Operasi Penugasan Pointer
#include "iostream.h"
#include "conio.h"
void main()
{ float *x1,y, *x2;
clrscr();
y = 13.45;
x1 = &y; /* Alamat dari y disalin ke variabel x1 */
x2 = x1; /* Isi variabel x1 disalin ke variabel x2 */
cout<<"Nilai variabel y = "<<y<< " ada di alamat "<< x1<<"\n";
cout<<"Nilai variabel y = "<<y<< " ada di alamat "<< x2<<"\n";
getch();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment