The second parameter to strcmp up there is actually a pointer--that's half of what an array is, just a location in memory (the other half is the field size, in this case char, to use when making offsets into the array).
...
if ( strcmp( words[i],words) == 0 )
...
error message says:
error c2664: 'strcmp' : cannot convert parameter 1 from 'char' to 'const char*'
..but then, i didn't use pointers
A few additional comments:
The value of count doesn't change, so it doesn't have to be in the loop--if that line assigning to z is really what you want to do.
...
for (int i=0; i<strlen(words); i++)
{
words[i]= tolower(words[i]);
z = count + 5;
}
...
Similar idea here. The loop will always end with i equal to count - 1, so making that last assignment to z doesn't have to be inside the loop--again, if that's what you want it to do.
...
for (i=0; i < count; i++)
{
if ( strcmp( words[i],words) == 0 )
z = i;
}
...
Continuing the same line of thought, z<count will always be true, so the if statement isn't necessary.
...
if (z<count)
{
ofstream file;
file.open("WORDS.txt", ios::app);
...
This last bit is a little strange--renaming a file that no longer exists?
...
system("del words.txt");
system("ren words.txt words.txt");
}
...
--sg