-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
Not sure how you manage to run the program as you cannot return stack variable and use it ???
Anyway a temp fix is to allocate a global variable and then return the allocate string :
std::string s;
const char* getStrokeText()
{
int biggestStroke = 0;
if (balls[1].getStrokes() > balls[0].getStrokes())
{
biggestStroke = balls[1].getStrokes();
}
else
{
biggestStroke = balls[0].getStrokes();
}
//std::string
s = "";
s = std::to_string(biggestStroke);
s = "STROKES: " + s;
return s.c_str();
}
const char* getLevelText(int side)
{
int tempLevel = (level + 1)*2 - 1;
if (side == 1)
{
tempLevel++;
}
// std::string
s = "";
s = std::to_string(tempLevel);
s = "HOLE: " + s;
return s.c_str();
}
Metadata
Metadata
Assignees
Labels
No labels