#include<stdio.h>
#include<conio.h>
#include<fstream.h>
void file()
{
for(int i=0;i<30;i++)
{
char a[10]="2-2aa.pak";
a[4]=a[4]+i%26;
a[3]=a[3]+((i/26)%26);
fstream file;
file.open(a,ios::in |ios::out);
file<<"anshulgarg";
file.close();
}
}
void main()
{
file();
}
it creates 30 files with new names in bin but when i give relative path ex
"\\p\\2-2aa.pak" and adjust a[8],a[9] appropriately it creates only one file instead of thirty please tell me how to use relative path.
Aim is to create 30 new files with diff names
i want this code to work relative path as well.