Ok, my question is perhaps more a pure C++ question than a Cocos2d-x question nevertheless as I just discovered CCMutableArray (much better than using C++ vectors , I ask the question )
What is the best way to “translate” the following Objective-C code to Cocos2d-X ?
[NSString stringWithFormat: @"my string = %@, my int = %d, my double = %f", myString, myInt, myDouble];
In other words, what is the easiest way to concatenate stings together ? Or strings with integers and doubles ?
Hey I used this and it worked fine for me… Same Code I used in other function and its giving bad_excess…
Its Damn frustrating. I’ve attached a screenshot. Please tell me wt wrong m doing… ???
You’re attempting to write data into a pointer that hasn’t been pointed to any valid memory. You either need to declare your char *scoreadd as char scoreadd[25] or however big it needs to be, or you need to somehow dynamically determine the size and do something like char *scoreadd = (char*)malloc(sizeof(variable));