I have been given a project which monitors 3 apartment's water usages. I need to write these usages into a binary file and the binary filename must be different for each apartment: The names must be:
"compact_usages_%d.bin"
where %d is either apartment 1, 2 or 3 and I am not allowed to use the following code:
sprintf(filename, "compact_usage_%d.bin", apartment);
Is there another way to do this without using sprintf() ?