sorting words using strings

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 1688 Views - Last Post: 28 January 2009 - 06:21 PM Rate Topic: -----

#16 David W  Icon User is offline

  • DIC supporter
  • member icon

Reputation: 281
  • View blog
  • Posts: 1,788
  • Joined: 20-September 08

Re: sorting words using strings

Posted 28 January 2009 - 06:21 PM

View PostKYA, on 28 Jan, 2009 - 05:12 PM, said:

Doing that only compares the first letter doesn't it? I recall a snippet where the person was trying to order an array of C++ strings and using those conditional operators only returned the first letter of each, which threw of her program.




C++ strings are readily compared with ==, >, >=, <, <=, != ...

The operators are 'overloaded' in C++ to properly compare C++ strings.

Try it out.

Shalom,
David
http://developers-he...index.php/topic,46.0.html
http://developers-he.../index.p...opic,106.0.html
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2