I have a class that returns an sf::String member variable as a reference like so:
sf::String& GetText()
{ return text; }
I call the function in the following way:
mass.GetText().SetText("mass");
The function properly returns the text variable, but I receive a runtime error when SetText() is called during variable assignment.
Unhandled exception at 0x002f4716 in Basebal sim.exe: 0xC0000005: Access violation writing location 0xcccccccc.
Clearly I'm trying to access an memory location that I'm not allowed to touch.
EDIT:: So I realized that the class really should be handling the manipulation of its own variables independently... I figure that I will just create a SetText function inside the class. I am still curious, however, why this routine won't working properly.
EDIT 2: So I still recieve the same error when I try to perform a similar operation within a class member function:
void SetText(std::string word)
{ text.SetText(word); }
The documentation says that the SetText function takes the type (const Unicode::Text &Text). I'm note exactly sure how to replicate this type. I imagine that my problem stems from this specification.