From: ads on
Hi,
I have a confusion in sorting the names in ascending order.Is
that necessary to use toascii function or strcmp function or anyother
to solve my problem.
Congratulations! if solved my problem.....
Reply soon.....

From: osmium on
"ads" wrote:

> I have a confusion in sorting the names in ascending order.Is
> that necessary to use toascii function or strcmp function or anyother
> to solve my problem.
> Congratulations! if solved my problem.....

Well, thank you.

I don't know what you have in mind about toascci function but probably not.
99.99% of the computers used already use ASCII as a native character code.
Yes, in C you would probably use strcmp or something similar. In C++ there
are better ways.



From: ads on
I expect a coding for sorting the names in ascending order....

From: Ulrich Eckhardt on
ads wrote:
> I have a confusion in sorting the names in ascending order. Is that
> necessary to use toascii function or strcmp function or anyother
> to solve my problem.

strcmp() compares two strings lexically and returns a value indicating
which sorts before the other or zero if both are equal. This should work
in most cases.

To be a bit more correct, you need to know that sorting of names or words
also depends on the country you are in, i.e. on the so-called locale. In
that light, you would use strcoll() instead. However, this is not all
there is to it and this is surely not something for a beginner, I just
wanted to mention it for completeness' sake.

Concerning toascii(), I have never heard of that one, but in any case you
should read the documentation for it.

Uli

--
FAQ: http://ma.rtij.nl/acllc-c++.FAQ.html
From: Ulrich Eckhardt on
ads wrote:
> I expect a coding for sorting the names in ascending order....

It would have been extremely helpful if you had quoted a relevant part of
what you were replying to. As it stands like this, this sounds like you
expect someone here to write code that sorts some unspecified names. Well,
this isn't going to happen - you will find help here to learn and people
will write a line or two, but you have to do the work yourself. Also,
please look up what 'expecting' means (I assume you're not a native
English speaker) because as it stands, your request is arrogant and
disrespectful.

Uli

--
FAQ: http://ma.rtij.nl/acllc-c++.FAQ.html