Pergunta

CCAssert(m_state == kPaddleStateGrabbed, L"Paddle - Unexpected state!");

this is cocos2d-x sample code (TouchesTest). what's mean 'L' in front of "Paddle - "?

Foi útil?

Solução

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.

Outras dicas

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).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top