Need a project done?

C++ Programming Developer

Search This Blog

Read from a file C++

Program to read from a file in C++.
#include <iostream>
#include <fstream>

using namespace std;

int main(){
ifstream infile;"rehan.txt");//rehan.txt must exist in the directory in which you've created your project.

char a[40];
while (infile){
cout << a << endl;
return 0;
See also:

Write in file C++

"Don't let anyone ever make you feel like you don't deserve what you want."