Nothxbye
Banned User
- Joined
- Jan 22, 2012
- Messages
- 1,124
- Reaction score
- 174
Jak fixnąc ten error, pasowalo by jakoś zastąpić tą linijke innym kodem.
error C2228: left of '.c_str' must have class/struct/union
type is 'const char *'
Code:
int32_t LuaScriptInterface::luaDatabaseEscapeBlob(lua_State* L)
{
uint32_t length = popNumber(L);
DBQuery query;
lua_pushstring(L, Database::instance()->escapeBlob(popString(L).c_str(), length).c_str()); ---- [COLOR="#FF0000"]Chodzi o ta linijke[/COLOR]
return 1;
}
Code:
const char* LuaScriptInterface::popString(lua_State *L)
{
lua_pop(L,1);
const char* str = lua_tostring(L, 0);
if(!str || strlen(str) == 0){
return "";
}
return str;
}
error C2228: left of '.c_str' must have class/struct/union
type is 'const char *'