Click here to Skip to main content
15,920,603 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Print Dialog appears sometimes Pin
Jo Fredrickson22-Nov-04 3:08
Jo Fredrickson22-Nov-04 3:08 
GeneralRe: WM_CTLCOLORBTN Pin
Michael Dunn20-Nov-04 19:16
sitebuilderMichael Dunn20-Nov-04 19:16 
GeneralRe: WM_CTLCOLORBTN Pin
Neville Franks20-Nov-04 22:58
Neville Franks20-Nov-04 22:58 
GeneralRe: WM_CTLCOLORBTN Pin
John R. Shaw21-Nov-04 6:10
John R. Shaw21-Nov-04 6:10 
GeneralRe: WM_CTLCOLORBTN Pin
Timothy Grabrian21-Nov-04 18:40
professionalTimothy Grabrian21-Nov-04 18:40 
GeneralRe: WM_CTLCOLORBTN Pin
John R. Shaw22-Nov-04 12:45
John R. Shaw22-Nov-04 12:45 
GeneralWM_CTLCOLORBTN Pin
Timothy Grabrian20-Nov-04 17:57
professionalTimothy Grabrian20-Nov-04 17:57 
GeneralSorting a linked list of type class Pin
Maxforce20-Nov-04 17:25
Maxforce20-Nov-04 17: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 19:08
Jack Puppy20-Nov-04 19:08 
GeneralRe: Sorting a linked list of type class Pin
Maxforce20-Nov-04 19:47
Maxforce20-Nov-04 19:47 
GeneralCustom CImageList VS manifest files Pin
alex.barylski20-Nov-04 14:16
alex.barylski20-Nov-04 14:16 
GeneralRe: Button and Testbox help Pin
bmzhao20-Nov-04 14:32
bmzhao20-Nov-04 14:32 
GeneralRe: Button and Testbox help Pin
Timothy Grabrian20-Nov-04 17:09
professionalTimothy Grabrian20-Nov-04 17:09 
GeneralCreateProcess stack overflow Pin
Michael Sobers20-Nov-04 11:59
Michael Sobers20-Nov-04 11:59 
GeneralRe: CreateProcess stack overflow Pin
BaldwinMartin20-Nov-04 17:22
BaldwinMartin20-Nov-04 17:22 
GeneralRe: CreateProcess stack overflow Pin
Michael Sobers22-Nov-04 10:23
Michael Sobers22-Nov-04 10:23 
GeneralRe: CreateProcess stack overflow Pin
BaldwinMartin22-Nov-04 12:08
BaldwinMartin22-Nov-04 12:08 
QuestionHow do you properly usethe Doc/View Pin
Larry Mills Sr20-Nov-04 11:45
Larry Mills Sr20-Nov-04 11:45 
AnswerRe: How do you properly usethe Doc/View Pin
qcha0s20-Nov-04 12:06
qcha0s20-Nov-04 12:06 
GeneralIncrementing object names in MFC Pin
Sgt.Xyclone20-Nov-04 9:33
Sgt.Xyclone20-Nov-04 9:33 
GeneralRe: Incrementing object names in MFC Pin
PJ Arends20-Nov-04 9:54
professionalPJ Arends20-Nov-04 9:54 
QuestionSNMP Anyone? Pin
qcha0s20-Nov-04 7:12
qcha0s20-Nov-04 7:12 
AnswerRe: SNMP Anyone? Pin
BaldwinMartin20-Nov-04 17:09
BaldwinMartin20-Nov-04 17:09 
AnswerRe: SNMP Anyone? Pin
Henry miller22-Nov-04 2:52
Henry miller22-Nov-04 2:52 
Generalwould like to launch request &quot;SHOW TABLE STATUS LIKE 'Clients'&quot; in VC++ Pin
Member 124237320-Nov-04 4:43
Member 124237320-Nov-04 4: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.