sir i have saved my file in D derive and i referenced it in code but after compilation following error has been occured. file could not open. code is given below.
#include<iostream>
#include<fstream>
using namespace std;
int main(){
char name[100];// used to read name of employee from file
char sal [100];// used to read name of employee from file
char dep[100];// used to read name of employee from file
ifstream inFile;
char inputFileName[]="D:\naveed/ali.txt";
inFile.open(inputFileName);
//checking the file is opened or not
if(!inFile){
cout<<"cannot open input file"<<"\t"<<inputFileName;
exit(1);
}
while(!inFile.eof()){
inFile>>name>>sal>>dep;
cout<<name<<"\t"<<sal<<"\t"<<dep;
}
inFile.close();
}