BUG: Character Constant with \0 Not Stored Properly

ID: Q122790


The information in this article applies to:
  • The C/C++ Compiler (CL.EXE), included with:
    • Microsoft Visual C++ 32-bit Edition, versions 1.0, 2.0, 4.0, 4.1, 4.2, 5.0, 6.0


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 this to be a bug in the Microsoft products 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
 

Keywords : kbcode kbDebug kbide kbVC
Version : winnt:6.0
Platform : winnt
Issue type : kbbug


Last Reviewed: January 31, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.