i have written the code and tried to compile, but it always say that the file can't be read, yet i have put the same name file in one directory with the c++ file.
need your help so can read the file on my mac..
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
int main ()
{
char filename[50];
ifstream balwin;
cin.getline(filename, 50);
balwin.open(filename);
if(!balwin.is_open ()) {
cout << "doesnt found" << endl;
exit (EXIT_FAILURE);
}
char word[50];
balwin >> word;
while(balwin.good()) {
cout << word << " ";
balwin >> word;
}
return 0;
}