我在cocos2d的C++应用程序下面的代码,但是代码不编译:C++ STD:字符串编译错误
std::string MyBasketTimer::getImageByType(MyBasket* basket) {
std::string retVal=NULL;
if(getBasketType()==1){
retVal= new std::string("count_bg.png");
}
else if(getBasketType()==2){
retVal= new std::string("count_bg.png");
}
return retVal;
}
的误差得到的是
invalid conversion from 'std::string* {aka std::basic_string<char>*}' to 'char' [-fpermissive]
我在做什么错误?
问题是,您正在尝试编写Java或C#,但在C++中。你应该选择一个好的初学者的书,并开始阅读。 – molbdnilo
[这里](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list)是这样的书的列表。 –