Hi
I have a small code and a question concern it.
What is the value of the first print of ptr2. I have 0. Why? Isn't suppose to be a memory address like for example 0xff10
thanks
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
//a: 0xdf30
//b: 0xef41
//ptr1: 0xff00
//ptr2: 0xff10
int a, b;
int *ptr1, *ptr2;
a = 3200;
ptr1 = &a;
b = *ptr1;
cout << a <<" " <<b << " "<<ptr1 <<" "<< ptr2 << endl;
ptr2 = ptr1;
cout << ptr2<<" " ;
cout << *ptr2<<" " ;
cout << *&ptr2 <<endl;
(*ptr1)++;
cout << ptr1 <<" "<< *ptr1 << " "<<a << endl;
getch();
return 0;
}