Question
CCAssert(m_state == kPaddleStateGrabbed, L"Paddle - Unexpected state!");
this is cocos2d-x sample code (TouchesTest). what's mean 'L' in front of "Paddle - "?
Solution
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.
OTHER TIPS
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).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow