struct T_baza
{
int pozycja;
char nazwisko[30];
char imie[30];
char nr_rejestracyjny[10];
char marka[30];
char model[30];
int rok_produkcji;
};
do
{
for (int i=0; i<liczba_elementow-1; i++)
{
string a=baza2[i].nazwisko;
string b=baza2[i+1].nazwisko;
if (a > b)
{
swap=baza2[i];
baza2[i]=baza2[i+1];
baza2[i+1]=swap;
}
}
liczba_elementow--;
}
while (liczba_elementow>1);
Jak posortowac tablice wg. nazwisk? Gdy porownuje stringi a i b jest blad.
error C2784: 'bool std::operator >(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'std::string'