Article ID: 198477
Article Last Modified on 12/2/2003
APPLIES TO
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
- Microsoft Visual C++ .NET 2002 Standard Edition
- Microsoft Visual C++ .NET 2003 Standard Edition
This article was previously published under Q198477
NOTE: Microsoft Visual C++ .NET (2002) and Visual C++ .NET (2003)
support both the managed code model that is provided by the .NET Framework and
the unmanaged native Windows code model. The information in this article
applies to unmanaged Visual C++ code only.
SYMPTOMS
Use of the compiler switch /ZI (Program Data Base for Edit
and Continue) may cause an access violation if you try to modify a text string.
RESOLUTION
Use one of the following workarounds:
- In the sample below, change "char * ptr" to "char
ptr[]".
- Do not use the /ZI switch.
STATUS
As per C++ Standard (2.13.4.2) the effect of attempting to
modify a string literal is undefined.
Additional query words: string strings arrays initialize initialise aggregate access
violation
Keywords: kbprb kbcompiler KB198477