By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

Casting const char* to void*

P: n/a
Is static_cast<void*>( const_cast<char*>( p )) the correct construction for
casting a const char* p to a void* p?

TIA.

Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Hakan" <bi*******@127.0.0.1> wrote in message news:ut**********************************@news.sni p.net...
Is static_cast<void*>( const_cast<char*>( p )) the correct construction for
casting a const char* p to a void* p?

Actually, you don't need the static_cast in most cases. Once you cast away
the const, the implicit conversion to void* will work.
Jul 22 '05 #2

P: n/a
On Tue, 25 Nov 2003 10:54:52 -0500, Ron Natalie wrote:

"Hakan" <bi*******@127.0.0.1> wrote in message news:ut**********************************@news.sni p.net...
Is static_cast<void*>( const_cast<char*>( p )) the correct construction for
casting a const char* p to a void* p?

Actually, you don't need the static_cast in most cases. Once you cast away
the const, the implicit conversion to void* will work.


Thank you, worked great.
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.