Why I need to typecast a const variable for outputiing it's address.
Code:const int i=39; cout<<(void *)&i;//Works Ok cout<<&i;//Error illegal structure operation.
Why I need to typecast a const variable for outputiing it's address.
Code:const int i=39; cout<<(void *)&i;//Works Ok cout<<&i;//Error illegal structure operation.
AFAIK...there is no need to typecast to get the address..it should work fine.....anyways what compiler are u usingOriginally Posted by vaibhav
"Service of the poor and destitutes is the service of the God"
Normative Changes to ISO/IEC 9899:1990 in Technical Corrigendum 1
Incompatibilities Between ISO C and ISO C++
Does it work fine on your compiler?I am using turbo c++.Do check it on your compiler.
Stop using that compiler...its 15 year old compiler...does not follows all standands....Originally Posted by vaibhav
Go for DEV C++ Compiler......You can download it from here
http://www.bloodshed.net/
"Service of the poor and destitutes is the service of the God"
Normative Changes to ISO/IEC 9899:1990 in Technical Corrigendum 1
Incompatibilities Between ISO C and ISO C++