In the application that I am working on, the logging facility makes use of sprintf
to format the text that gets written to file. So, something like:
char buffer[512];
sprintf(buffer, ... );
This sometimes causes problems when the message that gets sent in becomes too big for the manually allocated buffer.
Is there a way to get sprintf
behaviour without having to manually allocate memory like this?
EDIT: while sprintf
is a C operation, I'm looking for C++ type solutions (if there are any!) for me to get this sort of behaviour...