What is the "z" prefix in string literals?

Sample string:

std::string str = "z\u00df\u6c34\U0001F34C"; // or u8"zß水🍌"

I don't understand nor can I fin any information about the "z" prefix in this string,
why it must be there and what does it mean?

I've taken a look here to make sure I didn't miss anything:
https://learn.microsoft.com/en-us/cpp/cpp/string-and-character-literals-cpp

but there is no mention of any "z"
Last edited on
That isn't a prefix, it's just the first character of the string.
It's just possible that it somehow got confused with the 'Z' part of a "BOZ constant" - corresponding, somewhat weirdly, to hexadecimal.

However, in that case it should precede the string, not go inside it. As @Salem c says, as it stands it is the first character of the string.
lol, silly me...

Now that you said that it actually makes sense.
Registered users can post here. Sign in or register to post.