Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Can I modify a constant variable through a pointer obtained from const_cast?

Reply
Thread Tools

Can I modify a constant variable through a pointer obtained from const_cast?

 
 
Old Wolf
Guest
Posts: n/a
 
      07-26-2004
Andre Kostur <(E-Mail Removed)> wrote:
> JKop <(E-Mail Removed)> wrote in news:8OTLc.5288$(E-Mail Removed):
> >
> > It seems to me that C++ makes too many allowances for C's
> > faults. For instance:
> >
> > char* blah = "JKop";
> > blah[2] = 't';
> >
> > Undefined behaviour. But we wouldn't have this problem in
> > the first place if that didn't compile.
> >
> > The next "version" of C++ should be "C++ without the C
> > bullshit".

>
> You're in the wrong place for that argument. You want to be over in
> comp.std.c++


Argh, now we will have to put up with his junk in that newsgroup too.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I include include a constant in a constant array? Fredxx VHDL 3 07-15-2009 07:39 AM
Can't modify constant item in scalar assignment emrefan Perl Misc 4 06-05-2007 03:21 AM
I 'VE JUST OBTAINED MY MCSD FRANCIS KAITANO MCSD 2 06-08-2005 03:32 PM
"Non-constant" constant can't be used as template argument Martin Magnusson C++ 2 10-08-2004 08:41 AM
pointer to member function and pointer to constant member function Fraser Ross C++ 4 08-14-2004 06:00 PM



Advertisments