Click here to Skip to main content
15,847,263 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Print Dialog appears sometimes Pin
Jo Fredrickson22-Nov-04 4:08
Jo Fredrickson22-Nov-04 4:08 
GeneralRe: WM_CTLCOLORBTN Pin
Michael Dunn20-Nov-04 20:16
sitebuilderMichael Dunn20-Nov-04 20:16 
GeneralRe: WM_CTLCOLORBTN Pin
Neville Franks20-Nov-04 23:58
Neville Franks20-Nov-04 23:58 
GeneralRe: WM_CTLCOLORBTN Pin
John R. Shaw21-Nov-04 7:10
John R. Shaw21-Nov-04 7:10 
GeneralRe: WM_CTLCOLORBTN Pin
Timothy Grabrian21-Nov-04 19:40
professionalTimothy Grabrian21-Nov-04 19:40 
GeneralRe: WM_CTLCOLORBTN Pin
John R. Shaw22-Nov-04 13:45
John R. Shaw22-Nov-04 13:45 
GeneralWM_CTLCOLORBTN Pin
Timothy Grabrian20-Nov-04 18:57
professionalTimothy Grabrian20-Nov-04 18:57 
GeneralSorting a linked list of type class Pin
Maxforce20-Nov-04 18:25
Maxforce20-Nov-04 18:25 
Not even sure if the subject made sense. Anyway, I am trying to sort a linked list that contains a class. I thoughtConfused | :confused: overloading the operators would do it, but apparently not. Getting serious errors! The best way to describe is to see the code. here it is. Any help would be much appreciated.

#include <iostream>
#include <string>
#include <list>
#include <algorithm>
using namespace std;
class customerType{
public:
customerType (string f, string l, int acct){
first=f;
last=l;
accountnum=acct;
}
bool operator==(const customerType& right) const{
return (last==right.last);}
bool operator!=(const customerType& right) const{
return (last!=right.last);}
bool operator<=(const customerType& right) const{
return (last<=right.last);}
bool operator<(const customerType& right) const{
return (last<right.last);}
bool operator>=(const customerType& right) const{
return (last>=right.last);}
bool operator>(const customerType& right) const{
return (last>right.last);}
private:
string first;
string last;
int accountnum;
};

void main()
{ list<customerType> customerList;
customerType customer1("Joe","Schmoe", 9999);
customerType customer2("Moe","Ghoe", 11111);
customerType customer3("Loe","Adner", 4232);
customerType customer4("Roe","Boat", 4444);
customerList.push_front(customer1);
customerList.push_front(customer2);
customerList.push_front(customer3);
customerList.push_front(customer4);
cout<<customerList.size()<<endl;
//uncomment the line below for major errors!
// sort(customerList.begin(), customerList.end());
};

GeneralRe: Sorting a linked list of type class Pin
Jack Puppy20-Nov-04 20:08
Jack Puppy20-Nov-04 20:08 
GeneralRe: Sorting a linked list of type class Pin
Maxforce20-Nov-04 20:47
Maxforce20-Nov-04 20:47 
GeneralCustom CImageList VS manifest files Pin
alex.barylski20-Nov-04 15:16
alex.barylski20-Nov-04 15:16 
GeneralRe: Button and Testbox help Pin
bmzhao20-Nov-04 15:32
bmzhao20-Nov-04 15:32 
GeneralRe: Button and Testbox help Pin
Timothy Grabrian20-Nov-04 18:09
professionalTimothy Grabrian20-Nov-04 18:09 
GeneralCreateProcess stack overflow Pin
Michael Sobers20-Nov-04 12:59
Michael Sobers20-Nov-04 12:59 
GeneralRe: CreateProcess stack overflow Pin
BaldwinMartin20-Nov-04 18:22
BaldwinMartin20-Nov-04 18:22 
GeneralRe: CreateProcess stack overflow Pin
Michael Sobers22-Nov-04 11:23
Michael Sobers22-Nov-04 11:23 
GeneralRe: CreateProcess stack overflow Pin
BaldwinMartin22-Nov-04 13:08
BaldwinMartin22-Nov-04 13:08 
QuestionHow do you properly usethe Doc/View Pin
Larry Mills Sr20-Nov-04 12:45
Larry Mills Sr20-Nov-04 12:45 
AnswerRe: How do you properly usethe Doc/View Pin
qcha0s20-Nov-04 13:06
qcha0s20-Nov-04 13:06 
GeneralIncrementing object names in MFC Pin
Sgt.Xyclone20-Nov-04 10:33
Sgt.Xyclone20-Nov-04 10:33 
GeneralRe: Incrementing object names in MFC Pin
PJ Arends20-Nov-04 10:54
professionalPJ Arends20-Nov-04 10:54 
QuestionSNMP Anyone? Pin
qcha0s20-Nov-04 8:12
qcha0s20-Nov-04 8:12 
AnswerRe: SNMP Anyone? Pin
BaldwinMartin20-Nov-04 18:09
BaldwinMartin20-Nov-04 18:09 
AnswerRe: SNMP Anyone? Pin
Henry miller22-Nov-04 3:52
Henry miller22-Nov-04 3:52 
Generalwould like to launch request &quot;SHOW TABLE STATUS LIKE 'Clients'&quot; in VC++ Pin
Member 124237320-Nov-04 5:43
Member 124237320-Nov-04 5:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.