#include <stdlib.h>
#include <iostream>
using namespace std;
typedef unsigned short int USHORT;
int main()
{
using std::cout;
unsigned short int myAge = 5, yourAge = 10;
unsigned short int * pAge = &myAge; // wskaźnik
cout<<"Program pokazuje zawartosc komorek pamieci\n\n";
cout<<"myAge:\t"<<myAge<<"\t\tyourAge:\t"<<yourAge<<"\n";
cout<<"&myAge:\t"<<&myAge<<"\t&yourAge:\t"<<&yourAge<<"\n";
cout<<"pAge:\t"<<pAge<<"\n";
cout<<"*pAge:\t"<<*pAge<<"\n";
cout<<"\nPonowne przypisanie: pAge = &yourAge...\n\n";
pAge = &yourAge; // ponowne przypisanie do wskaźnika
cout<<"myAge:\t"<<myAge<<"\t\tyourAge:\t"<<yourAge<<"\n";
cout<<"&myAge:\t"<<&myAge<<"\t&yourAge:\t"<<&yourAge<<"\n";
cout<<"pAge:\t"<<pAge<<"\n";
cout<<"*pAge:\t"<<*pAge<<"\n";
cout<<"\n&pAge:\t"<<&pAge<<"\n";
getchar();
return 0;
}
#include <stdlib.h>
#include <iostream>
using namespace std;
typedef unsigned short int USHORT;
int main()
{
using std::cout;
unsigned short int myAge = 5, yourAge = 10;
unsigned short int * pAge = &myAge; // wskaźnik
cout<<"Program pokazuje zawartosc komorek pamieci\n\n";
cout<<"myAge:\t"<<myAge<<"\t\tyourAge:\t"<<yourAge<<"\n";
cout<<"&myAge:\t"<<&myAge<<"\t&yourAge:\t"<<&yourAge<<"\n";
cout<<"pAge:\t"<<pAge<<"\n";
cout<<"*pAge:\t"<<*pAge<<"\n";
cout<<"\nPonowne przypisanie: pAge = &yourAge...\n\n";
pAge = &yourAge; // ponowne przypisanie do wskaźnika
cout<<"myAge:\t"<<myAge<<"\t\tyourAge:\t"<<yourAge<<"\n";
cout<<"&myAge:\t"<<&myAge<<"\t&yourAge:\t"<<&yourAge<<"\n";
cout<<"pAge:\t"<<pAge<<"\n";
cout<<"*pAge:\t"<<*pAge<<"\n";
cout<<"\n&pAge:\t"<<&pAge<<"\n";
getchar();
return 0;
}