Code:
void sortDictionary(struct entry dictionary, int size)
{
int a,b;
struct entry temp;
for(a=0;a<size-1;a++)
{
for(b=a+1;b<size;b++)
{ // execute loop if compareString answer = 1
if(compareString(dictionary[a].word,dictionary[b].word)==1)
{
temp=dictionary[b];
dictionary[b]=dictionary[a];
dictionary[a]=temp;
}
}
}
return;
)
The compile errors I get from this are:
Code:
------ Build started: Project: structure array sort practice, Configuration: Debug Win32 ------
Compiling...
structure array sort practice.cpp
c:\documents and settings\cruisin'\my documents\visual studio 2008\projects\structure array sort practice\structure array sort practice\structure array sort practice.cpp(19) : error C2676: binary '[' : 'entry' does not define this operator or a conversion to a type acceptable to the predefined operator
c:\documents and settings\cruisin'\my documents\visual studio 2008\projects\structure array sort practice\structure array sort practice\structure array sort practice.cpp(19) : error C2228: left of '.word' must have class/struct/union
c:\documents and settings\cruisin'\my documents\visual studio 2008\projects\structure array sort practice\structure array sort practice\structure array sort practice.cpp(19) : error C2676: binary '[' : 'entry' does not define this operator or a conversion to a type acceptable to the predefined operator
c:\documents and settings\cruisin'\my documents\visual studio 2008\projects\structure array sort practice\structure array sort practice\structure array sort practice.cpp(19) : error C2228: left of '.word' must have class/struct/union
c:\documents and settings\cruisin'\my documents\visual studio 2008\projects\structure array sort practice\structure array sort practice\structure array sort practice.cpp(19) : error C3861: 'compareString': identifier not found