سؤال
CCAssert(m_state == kPaddleStateGrabbed, L"Paddle - Unexpected state!");
this is cocos2d-x sample code (TouchesTest). what's mean 'L' in front of "Paddle - "?
المحلول
L"a string"
simply declares the string as a Unicode string. The string is then not of type char*
but a wchar_t
.
This article covers Unicode strings in great detail.
نصائح أخرى
To be simple, it means the string is a type of wstring, which using wchat_t for each of its character, instead of using a normal char*. C++ treat Languages such as Chinese or Japanese Differently. For those Languages using more than one byte to represent a single character, it uses wchar_t (wide char).
لا تنتمي إلى StackOverflow