Try this code. I changed your character arrays to use STL strings and also changed the "end" command to "kill" so that the input file would work correctly.
Code:
#include <iostream>
#include <string>
using namespace std;
#include <cstring>
#include <fstream>
#include <conio.h>
#include <windows.h>
const char * file = "main.ec";
const char * outfile = "Out File.txt";
ofstream fout(outfile);
string out;
string instring;
string foutstring;
string comm;
void output()
{
cout << out;
}
void newline()
{
cout << endl;
}
void input()
{
getline(cin, instring);
}
void fileout()
{
fout.open(outfile);
fout << foutstring;
fout.close();
}
void filenewline()
{
fout.open(outfile);
fout << endl;
fout.close();
}
void pause()
{
getche();
}
void wait()
{
Sleep(1000);
}
void kill()
{
exit(0);
}
int main()
{
ifstream fin;
fin.open(file);
while (1)
{
getline(fin, comm);
if(comm == "out")
{
getline(fin, out);
output();
}
else if (comm == "newline")
{
newline();
}
else if (comm == "input")
{
input();
}
else if (comm == "fileout")
{
getline(fin, foutstring);
fileout();
}
else if (comm == "filenewline")
{
filenewline();
}
else if (comm == "pause")
{
pause();
}
else if (comm == "sleep")
{
wait();
}
else if (comm == "kill")
{
fin.close();
kill();
}
}
return 0;
}