I am writing a program to open any data file(dat)and read it. I can open only one file. That's means in program I write pFile=fopen("example.dat","r"), in here if I want to another file ,I have to change the filename again. but I want to give cout enter filename and input filename.
like this,
cout<<"enter filename":<<endl
cin>>filename
pFile=fopen("filename","r")
if wrote this way it didnt work.that's means can't I write this way