English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

6 answers

Remember that names are simply strings of characters, and characters are represented in ASCII. Fortunately, the folks that put together the ASCII table were smart enough to set it up such that 'a' < 'b' < 'c'....

So... all you have to do is walk down each string character by character and compare the two.

2006-10-19 06:30:18 · answer #1 · answered by Anonymous · 0 0

Those other answers are good but ...

it's most likely that your alphanumeric digits are stored as ASCII. So each letter is stored as a number as seen in the link. Lower case 'a' is decimal 97 and upper case 'A' is decimal 65. So one method would be to force all letters lower case. Then it becomes a matter of just is the first letter > this other words first letter? and if they have the same first letter, move to the next letter, and if one word ends before the next then handle that, and then sort them somehow which may be just organizing the pointers to your strings.

2006-10-19 06:43:55 · answer #2 · answered by Anonymous · 0 0

Travis is on the right track, but you'd only need to keep checking down two strings if they kept coming up equal. at the first difference you'll have your answer.

if you're still in trouble googling or yahoo'ing "c++ reference" brings up a wonderful site ^_^. ... google = 1st site. yahoo = 3rd site.

g'luck!

2006-10-19 06:55:33 · answer #3 · answered by Kuma 2 · 0 0

well you start with the letter a, then go on to aa, if none go to ab and so on, I don't think the alphabet chages cuz you're using C++....haha

2006-10-19 06:25:20 · answer #4 · answered by tranquilllity 2 · 1 0

do a google search for

bubble sort c++
or
sorting algorithms c++

2006-10-19 06:31:20 · answer #5 · answered by Deep Thought 5 · 0 0

sorry molly. I wish I could help you but i just don't know.
Hope you find the answer though.
Good luck

2006-10-19 06:24:08 · answer #6 · answered by USMCstingray 7 · 0 1

fedest.com, questions and answers