Hello, i am not decent at C++ but the following should work (but it doesn't)
//1 Doesnt work
sf::Text* ptxt = &dt->getElement(0);
std::cout << ptxt->getCharacterSize(); //size is printed correctly
ptxt->setCharacterSize(30);
std::cout << ptxt->getCharacterSize(); //size is changed correctly
ptxt->setString("No Sir");
window.draw(*ptxt); //Error
//2 Works
//sf::Text txt = dt->getElement(0);
//txt.setString("No sir");
//window.draw(txt);
//3 Works
//window.draw(dt->getElement(0));
I have a class that stores text on a vector and i fetch it in main for testing.
Although the example in the learning section of SFML works , parts 2 and 3 of the code work on their own - if i attempt to use the 1st part i get an error on the draw at runtime.