Latest Tech News

Stay updated with the latest in technology, AI, cybersecurity, and more

Filtered by: fstr Clear Filter

A string formatting library in 65 lines of C++

In this write-up, I will walk you through an implementation of a string formatting library for C++ I came up with for my video game. The end result came out really compact, at only 65 lines of code—providing a skeleton that can be supplemented with additional functionality at low cost. Usage Given a format buffer… char buffer [ 64 ] ; String_Buffer buf = { str , sizeof str } ; …the fmt::format function provided by this library can be called with a format string parameter, containing the char