Stay Tuned!

Subscribe to our newsletter to get our newest articles instantly!

C++ Programming

Write a C++ Program to Read a File

Factorial Using While

Write a C++ Program to Read 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();

}
Avatar

Tuts

About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.

You may also like

program to find leap year
C++ Programming

C++ Program to Find Leap Year by Using Function

  • March 3, 2016
Write a program to find if the inputted year is a leap year or not by using the concept of