So,I always had a big problem with text formatting,mainly because I don't understand why it's needed.
I mean I know you need string formatting to show int i = 1 to the screen as text,but why for other stuff?
For example,in one of my books there is something like this:
std::string p_apptitle;
std::string getAppTitle() { return this->p_apptitle; }
char title[255];
sprintf(title, "%s", g_engine->getAppTitle().c_str());
Why is sprintf needed? I mean apptitle is returned as a string already!
Can someone please explain the difference between sprint,printf? And why they are needed? Or just give me a link to a website or video,cause I tried finding one but I haven't found one that actually explains everything.