Thursday, May 30, 2013

Input Output C++ Membuka File

#include<iostream.h>
#include<fstream.h>
int main()
{
const int MAX = 80;
char buffer[MAX+1];

ifstream file_objek;
file_objek.open("latihan.txt");
cout<<"Membaca isi file latihan.txt\n";
while(file_objek)
{
file_objek.getline(buffer,MAX);
cout<<buffer<<endl;
}
}

No comments:

Post a Comment

Link