![]() ![]() You can use the returned string however you like. Std::string colorA = m圜har.GetTitleColor() // straightforwardĪuto colorB = m圜har.GetTitleColor() // better, color gets automatic type from method return typeĬonst auto & colorC = m圜har.GetTitleColor() // if we won't modify it, even better. Its use is very simple: // Assuming m圜har is a CHARACTER instance Because in C++ strings are std::string, not char*. Since it seems to cause a bit of confusion, I want to state that I purposefully changed the return type to be a std::string. (And rename that class, you don't want to use all-caps for anything but macros in a C++ program). Adapt formatting at will: drop the flags if you want decimal, remove the setw and fill if you don't need leading 0. This will write each color as a2-digit hex number. ![]() Why don't you use C++ tools? std::string CHARACTER::GetTitleColor() constīuffer.flags(std::ios_base::hex | std::ios_base::left) īuffer <<"r: " <<std::setw(2) <<dwTitleColor1 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |