File save with iteration number

Dear Friends
I want to save file with iteration number. What changes i have to do ?


 
  fopen_s(&fp4, "v velocity.plt", "w");

Thanks in Advance
1
2
3
4
char filename[100];
snprintf(filename,sizeof(filename),"%d velocity.plt",v);
errno_t err = fopen_s(&fp4, filename, "w");
// check err 
Topic archived. No new replies allowed.