removing repeated words form array

i need to remove repeated words in my 2D array(words).
Here is my code
int row=100;
int col=10;
int size=1000;
char *my_arr=new char [size];
char **words=new char *[row];
for (int k=0;k<row;k++)
{
words[k]=new char [col];
}
int length;
string filename;
cout<<"Enter filename: ";
cin>>filename;
ifstream fin(filename,ios::in);
int count=0;
const char *ep=";., ";
while(!fin.eof() )
{
fin.getline(my_arr,size,'\0');
for (char *tok=strtok(my_arr,ep);count<row&&tok;tok=strtok(NULL,ep))
{
strcpy(words[count++],tok);
}
}
fin.close();
bool A=0;
int c=0;
for (int counter=0;counter<count;counter++)
{
for (int j=counter+1;j<count;j++)
{
if (words[counter]==words[j])
{
A=1;
break;
}

}


}
for (int l=0;l<count;l++)
{
cout<<words[l]<<endl;
}
for (int y=0;y<row;y++)
delete[]words[y];
delete[]words;
delete []my_arr;

return 0;
}
problem is that when words match it should make my bool true but it doesnt..
something is wrong with my if condition i.e
if (words[counter]==words[j])
{
A=1;
break;
}
please help me with this
Topic archived. No new replies allowed.