Re: I don't understand why the compiler does this.



> However, when I insert a breakpoint at the line
> manip("thisisbad");
>
> [...]
>
> I don't get this error. Why is this?

The more technical explanation is that, in order to insert a
breakpoint, the debugger has to modify your code. Thus the page of
memory that contained your code, and your string, was changed to be
writeable at that point.

But, again, the direct explanation is that your code involved
undefined behavior, thus giving the compiler complete freedom in what
it produced.

b
.



Relevant Pages

  • Debugging C++ (Atl) code with Visual Studio 2005
    ... I am able to get the VS 2005 debugger to break at the breakpoint and I ... Wade. ... Prev by Date: ...
    (microsoft.public.vc.debugger)
  • Debugging C++ (atl) .dll with Visual Studio 2005
    ... I am able to get the VS 2005 debugger to break at the breakpoint and I ... Wade. ... Prev by Date: ...
    (microsoft.public.vsnet.debugging)
  • Re: TextBox Focus Problem
    ... Put a breakpoint on every statement in your code that says "txtNumber.Focus ... = True" and run it in the debugger and see what happens. ... >>text boxes. ... Prev by Date: ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: How to stop the debugger
    ... You can put conditions on a breakpoint. ... > How to stop the debugger at the line when a varible's value changes; ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: debugging question
    ... > put a breakpoint on the one return and see the value. ... > not using a debugger one can use a printf() to print the return value. ... Prev by Date: ...
    (comp.lang.c)