Hi everyonehelp!)
Assuming I have a class Seat that has both a
char Lastname[20];
and int seatIDNum;

I am overloading both the > & < operators to ease my sort by LastName (alpha) and by seat ID Num...(sort BACK from alpha to
ascending order 1-->12).
the functions are memberfunctions of class Seat so I can use the this pointer as the first parameter and compare the second seat's
data members to the this
here are the member function:
Code:
// Overloaded greater than operator
bool Seat::operator >( const Seat &seatB ) const
 { 
  
  if  ( (this->LastName) > (seatB.LastName))
   { return true; }
  else 
   { return false; }
  
 } // end function operator >

// Overloaded less than operator
bool Seat::operator <( const Seat *seatB ) const
 { 
  
  if  ((this->iSeatNum, seatB->iSeatNum))
   { return true; }
  else 
   { return false; }
  
 } // end function operator <
and my attempt to use them in my alpha function (also a data member, but of another class that has a private instance of an array of dynamically allocated Seats (seats).

Code:
 
//alphabetize:client function
void Airplane::alpha ()
//in: *s[], Mnum; out:none
{ 
 
 
 Seat *tempname;
 for (int i = 0; i < MAX_ITEMS; i++)
 {
  for (int j = i+1; j < MAX_ITEMS; j++)
  {
   
   //use of overloaded > operator 

   if ((seats[i] > seats[j]))  //this does not work 
   {
    tempname = seats[i];
    seats[i] = seats[j];
    seats[j] = tempname;
    
   }//if 
  }//for
 }//
 
 printalpha();
 
 //======switch back===========
 
 for (i = 1; i < MAX_ITEMS; i++)
 {
  
  for (int j = 0; j < MAX_ITEMS; j++)
  {

   //use of overloaded < operator  // i used an overloaded < to switch to ascending seat num... //this works! 


   if (seats[j] < seats[i]) 
   {
    tempname = seats[i];
    seats[i] = seats[j];
    seats[j] = tempname;
    
   }//if  
  }//for
 }//for  
}//Fx
my question: why is the > overloader OR the alpha function NOT
working to alphabetize by lastname? when i call the > in the beginning part of alpha the seats are arranged in descending order by seatIDnum!... I have tried this every which way and inside out..(my function works fine if I use pointers to getLastname instead of the overloaded opertor) so it's not the logic, it's that even using LastName in the bool it is somehow only seeing the ints (seatIDnum) wierd? or am I missing something.
thx alot
M