|
[05 Apr 2002|01:27am] |
|
Ok, C++ is really cool but this community is too slow. We had something going for a couple of weeks awhile ago. I think I might have a good idea. Why doesn't everyone introduce themselves. I've seen this work on kur5ion.org well. You can tell about your knowledge of C++ and what type of C++ programming you 're interested in. If everyone has a general idea of what people are interested in then it might be easier to post stuff we want to read and comment on. I'll post on this thread too.
|
|
|
[05 Apr 2002|01:33am] |
=\ I was gunna post a problem I'm having in my programming class, we had to make a phone book with addresses numbers and 3 part names blah all easy crap, you can input and delete entries etc. but when displaying the phone book you had to have it sorted in ABC order.. I tried first to use a bubble sort, thinking it would just do it by the ASCII values of the letters, not thinking that it would actually use pointers. any ways cracked open crappy old c++ for you++ any who here is my modified bubble sort for sorting strings
struct PHONE { char name[20], mi[20], last[20], number[11]; } phone[20];
void bubble_sort(PHONE array[], int arraylength) { int i,j, flag=1; PHONE temp; for(i=0;(i<=arraylength-1)&&flag;i++) { flag=0; for(j=1;j<(arraylength);j++) { if(strcmpi(array[j+1].last,array[j].last)<0) { temp=array[j+1]; array[j+1]=array[j]; array[j]=temp; flag=1; } } } }
|
|
|
[05 Apr 2002|06:42am] |
|
hahaa here is a challenge try and write my alphabetical bubble sort as a quick sort=) using all oop that is l337 ok time for school wish me luck on that program
|
|