1

How do I add the wide string prefix to a C-style string (in C++)?

I've seen the L added to literals:

L"Hello";

But given:

const char cs[] = "Hello";

neither L(cs); nor (L)cs; works. What is the correct way to express it?

CodeBricks
  • 1,771
  • 3
  • 17
  • 37
  • 'L' is a literal which instructs the (MSVC's) compiler about how to handle the string constant. It is not a somehow magical operator that can work on variables in run-time (there exist explicit conversion functions designed to perform this task, as referenced in linked question). – oakad May 21 '14 at 02:43

0 Answers0