How to read from file in c++ in ccs in linux ? -


i have got problem, want write code reads file, tried ifstream type doesn't work on linux. had similar problem ? write code in code composer studio,on code blocks works. have error "method 'fail' not resolved.) down below code:

#include <iostream> #include <fstream>  using namespace std;   int main ()  {  ifstream infile ("input.txt");  if (infile.fail())  {      cout << "could not open file\n";   }  else  {     cout << "file opened succesfully\n";  }   } 


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -