Why not just use std::strings?
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
you can do this: char* ptr = const_cast<char*>(param;) , but that defeats the purpose of using const in the first place. Casting out the const should be avoided whenever possible.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Either using :
const char* ptr = param ;
// or
char* ptr = const_cast<char*> (param) ;
But it would be interesting to know what you are trying to achieve here.....
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
Basically, I need to step through any array using pointers instead of the array indices. I changed my char* ptr to const char* ptr and it does work. Thanks.
But why would having a second const char* copy do you any good? Neither pointer can you modify, so copying it would be sort of pointless (sorry, bad pun).
John A
Vampirical Lurker
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339