I've been working on this project for my class for at least a week and I have had so many issues since I am just a novice who tried to jump into an advanced C++ class without prior programming knowledge. The project is to take a .txt file, then sort it in alphabetical order and finally print it out to the append.dat file.

I was wondering if I could get some help figuring out where I'm going wrong based on my criteria:

1. My program is printing out nothing to my append.dat file, which is pretty important for the project
2. The program cannot have any repeats, and it must remove excess characters (like commas and periods) and read again to remove words in which those excess characters would cause repeats
3. Hyphens must be removed if they are not in the middle of a word

4. With less importance, I'd like to make all words lowercase, which is what the "string loup" is trying to achieve. However, when active, I get the error "string subscript out of range"
5. Also less importance, if it's possible to condense this to contain less functions, that would be great too

This is my current progress (sorry if the comments are excessive):

Code:
#include<iostream>
#include<string>
using namespace std;
#include<conio.h>
#include<fstream>


/*string sorter(string line)
{
    int temp;
    string words;
    temp=line.length();
    for(int l=0; l<=line.length; l++)
    {
        if(words.substr(l, l)==" ")
        {


        }
    }
    words.substr(0, 1);
    return words;
}*/


/*string loup(string c)
{
    string temp="";
    for(int i=0; i<c.length()+1; i++)
    {
        temp+=tolower(c[i]);
    }
    return temp;
}*/


void print(string dictionary[10000])
{
    for(int r=0; r<10000; r++)
    {
        cout<<dictionary[r]<<endl;
    }
}


void bubble(string dictionary[10000])
{
    string temp;
    for(int y=0; y<10000; y++)
    
    {
        for(int g=0; g<10000; g++)
        {
            if(g==9999)
            {
                break;
                g=0;
            }
            else if(dictionary[g]>dictionary[g+1])
            {
                temp=dictionary[g];
                dictionary[g]=dictionary[g+1];
                dictionary[g+1]=temp;
            }
            else if(dictionary[g]==dictionary[g+1])
            {
                dictionary[g]="";
            }
        }
        if(y%1000==0)
        {
            cout<<"Current progress: "<<y<<endl;
        }
    }
    
}


string punctuation(string word[10000])
{
    string temp="";
    for(int p=0; p<10000; p++)
    {
        for(int s=0; s<word[p].length(); s++)
        if(word[p][s]==tolower(word[p][s]) && (word[p][s]==toupper(word[p][s]))||(word[p][s]='\'')||(word[p][s]='-'))
        {
                temp+=word[p];
        }
    }
    string hyphen;
    return temp;
}


string hyphen(string hyp)
{
    if(hyp.length()!=0)
    {
        if(hyp[0]=='-')
        {
            hyp[0]=' ';
        }
    }
    else
    {
        return hyp;
    }
}


void output(string dictionary[10000])
{
    ofstream outFile;
    outFile.open("append.dat", ios::app);
    for(int x=0; x<10000; x++)
    {
        if((dictionary[x]!="") && (dictionary[x]!=" "))
        {
            outFile<<dictionary[x]<<endl;
        }
    }
    outFile.close();
}


void main()
{
    ifstream inFile;
    string dictionary[10000], word[10000];
    inFile.open("SDawg.txt");
    int a=0;
    //string test;
    while(!inFile.eof())
    {
        //getline(inFile, dictionary[a]);
        if(a<10000)
        {
            inFile>>dictionary[a];
            //dictionary[a]=loup(dictionary[a]);
            a++;
        }
        else
        {
            break;
        }
        //a++;
        //test=line[a].substr(a, 1);
        //cout<<dictionary[a];
        //a++;
        /*if(dictionary[a]==" ");
        {
            temp=a;
            dictionary[a]=line[a].substr(temp, a);
            cout<<dictionary[a]<<endl;


        }
        a++;*/
    }
    for(int m=0; m<10000; m++)
    {
        dictionary[m]=punctuation(word);
    }
    bubble(dictionary);
    output(dictionary);
    /*for(int b=0; b<(b+1); b++)
    {
        sorter(dictionary[b]);
    }*/
    //cout<<dictionary<<endl;
    //inFile>>dictionary;
    /*outFile.open("append.dat", ios::app);
    outFile.close();*/
}
I'm not asking for a revamp of the code, just some help finding my errors. Deadlines are coming up and I'd prefer to exempt the final. Thanks in advance!