/J (Default char Type Is unsigned)
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

/J (Default char Type Is unsigned)


This option changes the default char type from signed char to unsigned char, and the char type is zero-extended when widened to an int type. If a char value is explicitly declared signed, the /J option does not affect it, and the value is sign-extended when widened to an int type.

The /J option defines _CHAR_UNSIGNED, which is used with #ifndef in the LIMITS.h file to define the range of the default char type.

ANSI C and C++ do not require a specific implementation of the char type. This option is useful when you are working with character data that will eventually be translated into a language other than English.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
  2. Click the C/C++ folder.
  3. Click the Language property page.
  4. Modify the Default Char Unsigned property.

To set this compiler option programmatically

See DefaultCharIsUnsigned Property.

See Also

Compiler Options | Setting Compiler Options

© 2015 Microsoft