BUG: Character Constant with \0 Not Stored Properly (122790)



The information in this article applies to:

  • Microsoft Visual C++, 32-bit Enterprise Edition 4.2
  • Microsoft Visual C++, 32-bit Enterprise Edition 5.0
  • Microsoft Visual C++, 32-bit Enterprise Edition 6.0
  • Microsoft Visual C++, 32-bit Professional Edition 2.0
  • Microsoft Visual C++, 32-bit Professional Edition 4.0
  • Microsoft Visual C++, 32-bit Professional Edition 4.1
  • Microsoft Visual C++, 32-bit Professional Edition 4.2
  • Microsoft Visual C++, 32-bit Professional Edition 5.0
  • Microsoft Visual C++, 32-bit Professional Edition 6.0
  • Microsoft Visual C++, 32-bit Learning Edition 4.0
  • Microsoft Visual C++, 32-bit Learning Edition 4.2
  • Microsoft Visual C++, 32-bit Learning Edition 6.0

This article was previously published under Q122790

SYMPTOMS

Character constants containing the escape character "\0" (octal) may not be stored properly. The escape character may be swapped with the character that immediately preceeds or follows it in memory.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Run the following sample code to demonstrate the problem.

Sample Code to Reproduce Problem


/* Compile options needed: none
*/ 

#include <stdio.h>

void main(void)
{
   printf("%08X", 'A\0H\0');
}

/* Output */ 

00410048

/* Expected Output */ 

41004800

				

Modification Type:MinorLast Reviewed:7/5/2005
Keywords:kbBug kbcode kbDebug kbide kbpending KB122790