View Single Post
  #2 (permalink)  
Old May 19th, 2008, 06:18 AM
ciderpunx ciderpunx is offline
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Here's a generic bubble sort:
http://mathbits.com/mathbits/compsci/Arrays/Bubble.htm

You also need to look up strcmp which compares two strings, see for example:
http://www.cplusplus.com/reference/c...ng/strcmp.html

You may want to make sure that you truncate your strings to the 25 characters that you've allowed in the elements of your names array. You would typically do this with cin.read(char *buffer, int n) or use the setw function thus cin >> setw(25) >> name[i].



--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk
Reply With Quote