Hello,

I'm trying to do the following. It's a code that corrects a sentence. That's one of the input files:

Code:
delete("is",2)
print 1:This 2:is 3:an 4:an 5:icorrect 6:sntence
delete("an",3)
print 1:This 2:is 3:an 4:icorrect 5:sntence
delete("icorrect",4)
print 1:This 2:is 3:an 4:sntence
insert("incorrect",4)
print 1:This 2:is 3:an 4:incorrect 5:sntence
delete("sntence",5)
insert("sentence",5)
print 1:This 2:is 3:an 4:incorrect 5:sentence
neighbors("is") 2:is previous:This next:an
So, first it's "This is is an an icorrect sntence", and after the code has sorted everything, it's gonna be "This is a correct sentence".

Because I don't know how large the input, I thought I would use this to get the input:

Code:
#include <iostream>
#include <fstream>
using namespace std;

int main () {
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}
Now I don't know how to create the array and populate it. Will this work?

Code:
template <class elemType>
bool arrayListType<elemType>::isempty() const
{
return (length == 0);
}
template <class elemType>
bool arrayListType::isFull() const
{
return (length == maxSize);
}

template <class elemType>
int arrayListType<elemType>::listSize() const
{
return lenght;
}
template <class elemType>
int arrayListType<elemType>::maxListSize() const
{
return maxSize;
}

Any help/input is appreciated! Thank you