Hi I am trying to read a file name from another file and then read it. But I can only read the first file which contains the name of the second file I want to open. Here is how I am doing it..
int main()
{
freopen("input1.txt","r",stdin);
while(cin>>fileName>>source>>destination)
{
//reads perfectly
char file[100];
for(int i=0;i<(int)fileName.size();i++)
file[i] = fileName[i];
file[(int)fileName.size()] = NULL;
freopen(file,"r",stdin);
mp.clear();
mp1.clear();
for(int i=0;i<cityNumber;i++)
adj[i].clear();
cityNumber = 0;
while(cin>>city1>>city2>>distanc)
{
//doesn't read
}
}