S
Shan
Hi all,
In the following code the line *(int *)&i = 11; is confusing to me.
What is it doing ?
#include<iostream>
using namespace std;
int main()
{
const int i = 10;
*(int *)&i = 11;
cout<<i<<endl;
cout<<"(int *) i = "<<*(int *)&i<< endl;
cout<<"The value of i is "<<i;
return 0;
}
Thanks in advance.
Regards
Shan
In the following code the line *(int *)&i = 11; is confusing to me.
What is it doing ?
#include<iostream>
using namespace std;
int main()
{
const int i = 10;
*(int *)&i = 11;
cout<<i<<endl;
cout<<"(int *) i = "<<*(int *)&i<< endl;
cout<<"The value of i is "<<i;
return 0;
}
Thanks in advance.
Regards
Shan