1、cocos2dx中自带了存储类:CCUserDefault
//逻辑类型getBoolForKey
//小数型getFloatForKey
//字符串型std::stringgetStringForKey
注释:#include"string"
if(!CCUserDefault::sharedUserDefault()->getIntegerForKey("key"))
{
setIntegerForKey,45);
flush();
}else
::
}
原文链接:https://www.f2er.com/cocos2dx/345005.html