Kod:
#include <iostream>
using namespace std;
int main()
{
unsigned long int bigNumberA=100;
unsigned long int bigNumberB=101;
unsigned long int bigNumberC=102;
cout << "unsigned long int size: " << sizeof(bigNumberA) << "\n\n";
cout << "bigNumberA: " << bigNumberA << "\n";
cout << "&bigNumberA: " << dec << &bigNumberA << "\n\n";
cout << "bigNumberB: " << bigNumberB << "\n";
cout << "&bigNumberB: " << &bigNumberB << "\n\n";
cout << "bigNumberC: " << bigNumberC << "\n";
cout << "&bigNumberC: " << &bigNumberC << "\n\n";
return 0;
}
Wynik:
unsigned long int size: 4
bigNumberA: 100
&bigNumberA: 0xbff6daa0
bigNumberB: 101
&bigNumberB: 0xbff6da9c
bigNumberC: 102
&bigNumberC: 0xbff6da98
Ideone:
Czym jest 0x na początku adresu ?