Now I have the below, which compiles, but crashes when i try to run it.
Code:
#include <iomanip.h>
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
#include <ctype.h>
int main()
{
char str[10];
//Used later
ofstream a_file("example.txt");
//Creates an instance of ofstream, and opens example.txt
a_file<<"This text will now be inside of example.txt/n";
//Outputs to example.txt through a_file
a_file.close();
//Closes up the file
ifstream b_file("example.txt");
//Opens for reading the file
b_file.getline(str,100,'/n');
//Reads one string from the file
cout<<str;
cout<<str;
cout<<str;
cout<<str;
cout<<str;
cout<<str;
cout<<str;
cout<<str;
//Should output 'this'
b_file.close();
//Do not forget this!
getch();
}