Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Unrecognized escape sequence

I want to create a string that contains all possible special chars.

However, the compiler gives me the warning "Unrecognized escape sequence" in this line:

wstring s=L".,;*:-_⁊#‘⁂‡…–«»¤¤¡=„+-¶~´:№\¯/?‽!¡-¢–”¥—†¿»¤{}«[-]()·^°$§%&«|⸗<´>²³£­€™℗@©®~µ´`'" + wstring(1,34);

Can anybody please tell me which one of the characters I may not add to this string the way I did?

like image 794
tmighty Avatar asked May 31 '26 09:05

tmighty


1 Answers

You have to escape \ as \\, otherwise will be interpreted as an (invalid) escape sequence:

wstring s=L".,;*:-_⁊#‘⁂‡…–«»¤¤¡=„+-¶~´:№\\¯/?‽!¡-¢–”¥—†¿»¤{}«[-]()·^°$§%&«|⸗<´>²³£­€™℗@©®~µ´`'" + wstring(1,34);
like image 120
Stefano Sanfilippo Avatar answered Jun 03 '26 00:06

Stefano Sanfilippo