Why is there an L before the string when creating a wstring?
e.g. -
std::string = "regular string :3";
std::wstring = L"wide string :/";
Is it because it's referenced with the LPSTR, LPWSTR, and LPCSTR's?
Why is there an L before the string when creating a wstring?
e.g. -
std::string = "regular string :3";
std::wstring = L"wide string :/";
Is it because it's referenced with the LPSTR, LPWSTR, and LPCSTR's?
You're on the right track that this has something to do with LPSTR, LPWSTR, and LPCSTR, but that's not precisely what's going on here. Those types aren't actually a part of standard C++ and are a Microsoft-specific set of types that are used with the Windows API.
C++ has two built-in types for characters, char, which is used with std::string, and wchar_t, which is used with std::wstring. If you write a string literal in regular quotes, C++ treats it as an string made of chars, which can be used with std::string. To tell C++ that you're trying to make a string literal made of wchar_ts - which is what you'll need to use to work with std::wstring, you need to prefix it with an L because that's just how C++ is defined.
Note that this is totally independent of the Microsoft types mentioned above.