Click here to Skip to main content
15,905,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Printing an image Pin
Christian Graus30-Oct-05 16:53
protectorChristian Graus30-Oct-05 16:53 
QuestionSPDRP_FRIENDLYNAME Pin
LiYS29-Oct-05 16:41
LiYS29-Oct-05 16:41 
QuestionCListCtrl Error Pin
Allad29-Oct-05 15:05
Allad29-Oct-05 15:05 
Questionnumber picker thingie Pin
alex@zoosmart.us29-Oct-05 12:11
alex@zoosmart.us29-Oct-05 12:11 
AnswerRe: number picker thingie Pin
Joe Woodbury29-Oct-05 13:06
professionalJoe Woodbury29-Oct-05 13:06 
GeneralRe: number picker thingie Pin
alex@zoosmart.us30-Oct-05 12:05
alex@zoosmart.us30-Oct-05 12:05 
GeneralRe: number picker thingie Pin
Joe Woodbury30-Oct-05 17:19
professionalJoe Woodbury30-Oct-05 17:19 
Questionsort structures Pin
kerrywes29-Oct-05 9:57
kerrywes29-Oct-05 9:57 
i have a struct array:

typedef struct _PERSON
{
TCHAR *firstName;
TCHAR *lastName;
TCHAR *address;
TCHAR *phone;
} PERSON;

which a properly alloc in annn array of people[10]

then i call:
myAddressBook *book = new myAddressBook(_T("first"),_T("slast"),_T("phone"),_T("add"));
book->addPerson(_T("first"),_T("aaaaa"),_T("phone"),_T("add"));
book->addPerson(_T("first"),_T("bbbbb"),_T("phone"),_T("add"));
book->addPerson(_T("first"),_T("ddddd"),_T("phone"),_T("add"));
book->addPerson(_T("first"),_T("ccccc"),_T("phone"),_T("add"));
book->sortPeople(book->people,book->mTotal);
heres the func:
void myAddressBook::sortPeople(PERSON *per, int num)
{
PERSON *temp;
for (int x=0;x<(mTotal-1); x++)
{
if (_tcsncmp(per[x].lastName, per[x+1].lastName, _tcslen(per[x].lastName)) > 0)
{
//str2 is biggerr, so- swap em
temp = &per[x];
per[x] = per[x+1];
per[x+1] = *temp;
}
}
}

the results are not right, duplicated entries and other oddness, whats wrong?
AnswerRe: sort structures Pin
Chris Losinger29-Oct-05 12:03
professionalChris Losinger29-Oct-05 12:03 
AnswerRe: sort structures Pin
Joe Woodbury29-Oct-05 13:11
professionalJoe Woodbury29-Oct-05 13:11 
AnswerRe: sort structures Pin
Ghasrfakhri29-Oct-05 19:21
Ghasrfakhri29-Oct-05 19:21 
Questioncant signin to homtmail using Pin
whatever8929-Oct-05 9:29
whatever8929-Oct-05 9:29 
Questionfile system type Pin
Chintoo72329-Oct-05 7:26
Chintoo72329-Oct-05 7:26 
AnswerRe: file system type Pin
Mircea Puiu29-Oct-05 7:45
Mircea Puiu29-Oct-05 7:45 
Questiontooltip for CDC drawing areas ?? Pin
tbrake29-Oct-05 6:15
tbrake29-Oct-05 6:15 
Questionmulti thread sinz Pin
jojojojoj29-Oct-05 3:51
jojojojoj29-Oct-05 3:51 
AnswerRe: multi thread sinz Pin
S. Senthil Kumar29-Oct-05 7:50
S. Senthil Kumar29-Oct-05 7:50 
GeneralRe: multi thread sinz Pin
jojojojoj29-Oct-05 11:00
jojojojoj29-Oct-05 11:00 
QuestionListCtrl problem Pin
shivditya29-Oct-05 2:00
shivditya29-Oct-05 2:00 
Questionfile transfer Pin
Orell29-Oct-05 1:28
Orell29-Oct-05 1:28 
AnswerRe: file transfer Pin
shivditya29-Oct-05 2:28
shivditya29-Oct-05 2:28 
QuestionmciSendString and fullscreen Pin
Sasuko29-Oct-05 1:19
Sasuko29-Oct-05 1:19 
Questionreading and writing .xml files Pin
Warier29-Oct-05 0:37
Warier29-Oct-05 0:37 
AnswerRe: reading and writing .xml files Pin
toxcct29-Oct-05 2:16
toxcct29-Oct-05 2:16 
AnswerRe: reading and writing .xml files Pin
Ravi Bhavnani29-Oct-05 4:11
professionalRavi Bhavnani29-Oct-05 4:11 

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.