Trifon Triantafillidis

Hello,

I need to define a long string constant (>500 chars) that contains some illegal characters. The equivalent C# syntax is something like

Code Snippet

String s = "\u0024\u006D\u007C\u002B\u006D\u0044\u0060\u0063\u006C\u0078\u0061\u0044\u0045\u007A\u005E";

The following syntax in C++ throws a c3851 compiler error:

Code Snippet

String^ s = "\u0024\u006D\u007C\u002B\u006D\u0044\u0060\u0063\u006C\u0078\u0061\u0044\u0045\u007A\u005E";

I have tried replacing \u with \x but I am not sure if that is completely equivalent

Any ideas

Thanks



Re: Visual C++ General C3851 compiler error

Shakje

Find the relavant ASCII codes for the illegal characters and use \000 replacing the three 0s with the ascii code. \x000 takes ASCII codes as well and stores them in hex instead of octal. So neither will work with Unicode numbers.




Re: Visual C++ General C3851 compiler error

Trifon Triantafillidis

Hi thanks for the suggestion but I think that \u stands for unsigned but still hexadecimal not octal and \x does the same job but for signed hexadecimal.