Adding group of integers to string
Hey guys,
I am trying to throw in a couple integer values to a char[].
In the array I have the date broken down with the struct tm variables into year month and day. Here is what I have.
Code:
char fileName[] = "Catalog_%i_%i_%i_am.txt", year, month, day;
I'm pretty sure the syntax is wrong but I cannot find anything online about doing this.
It compiles fine and when it runs the output is:
Catalog_%i_%i_%i_am.txt
It leaves the '%i' in there.
Thank you for your time.
Dominic