Hello again,
I tried using the [index + 1] = temp) statement, but I get some: '=' : cannot convert from 'char *' to 'char [25]' compile time error. Here is (part of the) function (trying to sort words in a file): Any suggestions why I get this error.
void sort(char word[][25], int size, int& number)
{
using namespace std;
int index, result;
ifstream fin;
fin.open("bob.txt"

;
for(index = 0;! fin.eof() && index < 100; index++) //Fills Array
{
fin.getline(word[index], 25);
}
number = index;
for (index = 0; index < number; index ++)
{
result = strcmp(word[index], word[index +1]);
if( result > 0 ) //Sort words
{
char *temp;
temp = word[index];
strcpy (word[index], word[index +1]);
word[index + 1] = temp;
}
}
}
The program works if I remove word[index + 1] = temp, but I need that line to switch the words.
Thanks for Your Help
Sklar