Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 981 Bytes

compiler-error-c3851.md

File metadata and controls

28 lines (22 loc) · 981 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3851
Compiler Error C3851
09/05/2018
C3851
C3851
da30c21c-33aa-4439-8fb3-2f5021ea4985

Compiler Error C3851

'char': a universal-character-name cannot designate a character in the basic character set

Remarks

In code compiled as C++, you cannot use a universal character name that represents a character in the basic source character set outside of a string or character literal. For more information, see Character Sets. In code compiled as C, you cannot use a universal character name for characters in the range 0x20-0x7f, inclusive, except for 0x24 ('$'), 0x40 ('@'), or 0x60 ('`').

Example

The following samples generate C3851, and show how to fix it:

// C3851.cpp
int main()
{
   int test1_\u0041 = 0;   // C3851, \u0041 = 'A' in basic character set
   int test2_A = 0;        // OK
}