Click here to Skip to main content
15,914,363 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Debuggin In Visual C++ .NET Pin
Chris Losinger6-Oct-05 5:16
professionalChris Losinger6-Oct-05 5:16 
GeneralRe: Debuggin In Visual C++ .NET Pin
BlitzPackage6-Oct-05 17:46
BlitzPackage6-Oct-05 17:46 
GeneralRe: Debuggin In Visual C++ .NET Pin
Chris Losinger7-Oct-05 1:02
professionalChris Losinger7-Oct-05 1:02 
AnswerRe: Debuggin In Visual C++ .NET Pin
Gary R. Wheeler9-Oct-05 4:36
Gary R. Wheeler9-Oct-05 4:36 
QuestionDelayed rendering OLE Pin
Henrik Pettersson6-Oct-05 4:56
Henrik Pettersson6-Oct-05 4:56 
Questionwindow level, window width...in a jpg? Pin
raw_enha6-Oct-05 3:21
raw_enha6-Oct-05 3:21 
AnswerRe: window level, window width...in a jpg? Pin
Prakash Nadar6-Oct-05 15:53
Prakash Nadar6-Oct-05 15:53 
Questioncast operator overloading Pin
Chintoo7236-Oct-05 2:51
Chintoo7236-Oct-05 2:51 
I have a class like this:

class C {
private:
char *str;
public:
const char *getStr() { return str;}
};

This protects "str" from getting modified from outside. But thats only a myth, it can actually be modified through casting. For eg, I have been using the following for a while (it is actually very convenient for me, and safe in my application):

PathRemoveFileSpec(const_cast<char *="">(obj.getStr()))


But, I am wondering if there is any way to prevent somebody from doing this. we can perhaps overload the cast operator and make it private, but operator is on the object, not on the "char *" that is returned by getStr().

Any ideas anyone?
AnswerRe: cast operator overloading Pin
Chintoo7236-Oct-05 3:07
Chintoo7236-Oct-05 3:07 
GeneralRe: cast operator overloading Pin
Chintoo7236-Oct-05 3:09
Chintoo7236-Oct-05 3:09 
GeneralRe: cast operator overloading Pin
toxcct6-Oct-05 3:47
toxcct6-Oct-05 3:47 
GeneralRe: cast operator overloading Pin
Prakash Nadar6-Oct-05 16:03
Prakash Nadar6-Oct-05 16:03 
AnswerRe: cast operator overloading Pin
icabod6-Oct-05 4:09
icabod6-Oct-05 4:09 
AnswerRe: cast operator overloading Pin
Bob Stanneveld6-Oct-05 10:36
Bob Stanneveld6-Oct-05 10:36 
QuestionNetwork address translation help needed ! Pin
Radu Sorin6-Oct-05 2:49
Radu Sorin6-Oct-05 2:49 
Questiondisable quickedit in command window Pin
Ken Goguen6-Oct-05 1:36
Ken Goguen6-Oct-05 1:36 
AnswerRe: disable quickedit in command window Pin
andre123451-May-09 3:38
andre123451-May-09 3:38 
QuestionUnicode font identification Pin
Nishad S6-Oct-05 1:34
Nishad S6-Oct-05 1:34 
QuestionHow to set Icon for EXE ? Pin
Amarelia6-Oct-05 0:45
Amarelia6-Oct-05 0:45 
AnswerRe: How to set Icon for EXE ? Pin
Rage6-Oct-05 1:05
professionalRage6-Oct-05 1:05 
AnswerRe: How to set Icon for EXE ? Pin
Eytukan6-Oct-05 1:46
Eytukan6-Oct-05 1:46 
GeneralRe: How to set Icon for EXE ? Pin
Amarelia6-Oct-05 1:54
Amarelia6-Oct-05 1:54 
GeneralRe: How to set Icon for EXE ? Pin
Eytukan6-Oct-05 3:16
Eytukan6-Oct-05 3:16 
GeneralRe: How to set Icon for EXE ? Pin
toxcct6-Oct-05 3:51
toxcct6-Oct-05 3:51 
AnswerRe: How to set Icon for EXE ? Pin
David Crow6-Oct-05 2:24
David Crow6-Oct-05 2:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.