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.
Printable View
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 usingQuote:
Originally Posted by vaibhav
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....Quote:
Originally Posted by vaibhav
Go for DEV C++ Compiler......You can download it from here
http://www.bloodshed.net/