السلام عليكم ورحمة الله وبركاته
ممكن تفسير يا إخوان لمخرجات هذا الكود ؟؟؟؟
#include <iostream>
using namespace std;
int main()
{
double x, y;
int *p;
x = 123.23;
p = (int *) &x; // use cast to assign double * to int *
*p = 79;
y = *p;
cout<<"x is : "<<x<<endl;
cout<<"*P is "<<*p<<endl;
cout <<"y is "<<y<<endl;
cout<<"the address of x "<<&x<<endl;
cout<<"p point to "<<p<<endl;
system("pause");
return 0;
}ممكن تفسير .... لماذا قيمة x لم تتغير ؟؟
مع أن :
*P is : 79

