The following creates a file names "probexxxxonYYYYMMDD.dat"
where:
File_Name is a string
the xxxx is a serial number
on just makes it read better
YYYY is the year
MM is the month
DD is the day of the month.
You should be able to modify it to suit your needs.
sprintf( File_Name, "Probe%09don%04i%02i%02i.dat",
CP_ID_Num, Date_Rec.Year, Date_Rec.Month, Date_Rec.Date);
//open a file for writing diagnostics
My_File = fopen( File_Name, "w" );