#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
int main () {
char buffer[256];
ifstream examplefile ("fil.txt");
if (! examplefile.is_open())
{
cout << "Kunne ikke åpne fila";
exit (1);
}
while (! examplefile.eof() )
{
examplefile.getline (buffer,100);
cout << buffer << endl;
}
return 0;
}
Viktige funksjoner: