Write a C++ Program to Read a File

Write a C++ Program to Read a File.
- C Structure Explanation of C Program
- C++ Program to Insert Ten Elements in Array and Sort Them
- C++ Program to Input Marks and Find Grade and CGPA
- C++ Find Minimum Value using Function Overloading
- Write a C++ Program to Create a File
Source Code
#include<fstream> #include<iostream> #include<conio.h> using namespace std; int main() { char buffer[100]; int maxlength=100; ifstream fin("myfile.txt"); while (fin) { fin.getline(buffer,maxlength); cout<<buffer<<endl; } fin.close(); getch(); }