Can someone check my code??? C++?

Question by ward e: Can someone check my code??? C++?
I have put this code together, but it needs to count user input and save it to an external file. As of now it is only reading a file searching for: but’s, and’s and semicolons. Can anyone help me modify this to count the words as user types them in? Any insight would be great! Thanks!

#include
#include
#include
#include

#define DELIMS ” .\n”

using namespace std;

int main(int argc, char** argv)

{

char word[100][16]; //Stores Words
char line[101]; //Temporary stores lines
int count[100]; //Counts the no times word is repeated
char butword[16]; //Stores but
char andword[16]; //Stores and
char semicolonword[16];//Stores semicolon
int wbut = 0;
int wand=0;
int wsemi=0;
char *p;
int i=0;
int totalnosofwords=0; //Count of total no of words
int noofuniq=0; //Count total no of unique words
int nosoflines=0; //Counts no of lines

ifstream fin; // fin is like cin.
fin.open(txt.txt); // opens the file

if(!fin) //Checking if input file is Valid

{
cout << "While opening a file an error is encountered" << endl; exit(1); } ofstream fout; // fin is like cin. fout.open(output.txt); // opens the file if(!fout) //Checks if output file is valid { cout << "While opening a file an error is encountered" << endl; exit(1); } while(!fin.eof()) //Reads the input file till the end { fin.getline(line, 101); //Reads one line at a time from input file fout< words; // an array of words
while( fin.getline(line, 100) )
{
p = strtok(line, DELIMS );
while( !p )
{
words.push_back(p);
p = strtok(NULL, DELIMS);
}
}

}

fin.close(); //Close input file

totalnosofwords=i; //Get the total no of words

noofuniq=i; //Get the Max no of words

for(int j=0; j0) //Check is that word has been previously checked

{

if(strlen(word[j])>butword) // Comapres but to previous word

{

strcpy(wbut,word[j]); //If it is but it in word[j]

butword=strlen(word[j]); //Get the length of but word

}

if(strlen(word[j])0)

{

fout<Best answer:

Answer by edhurt7
wow, i wish i knew how to code in C++

What do you think? Answer below!