You need to avoid backslashes in the file name. In C ++ string constants, the backslash is an escape character that does not represent itself. To get a literal backslash, you need to use a double backslash \\ .
\U is a prefix for the Unicode 32-bit escape sequence: you should use something like " \U0010FFFF " to represent a high Unicode character. The compiler complains that \Users... not a valid Unicode escape sequence, since sers... not a valid hexadecimal number.
The fix is ββto use the string "C:\\Users\\My Name\\Desktop\\test\\input.txt" .
source share