How come you can assign an address to an integer variable like this,the complier will not give an error. i always though you can only assign integer values to a integer variable
int a=0x28ff1c
You can do the same for a char variable, the complier will not give a error
char b=0x28ff1c
It will output on the console screen rubbish value for char b and a random value for int a
cout<<b
<<endl;
cout<<a;
Can someone explain to me why there is a difference in the output for char b and int a. Can someone aslo explain to me why a char variable and integer variable can have addresses assign to it
0x28ff1cis an integer value.