I can seem to get sort to work. I use the using namespace std at the
beginning of my program, and sort appears to be there, but when I compile my
program, it says sort is not a member of namespace std. I am tryint to use
sort to sort a CStringArray.

Z.K.

Re: namespace std sort function not working by Duane

Duane
Mon Oct 22 16:21:05 PDT 2007


"Z.K." <nospam@nospam.net> wrote in message
news:OWiy25PFIHA.5228@TK2MSFTNGP05.phx.gbl...
>I can seem to get sort to work. I use the using namespace std at the
>beginning of my program, and sort appears to be there, but when I compile
>my program, it says sort is not a member of namespace std. I am tryint to
>use sort to sort a CStringArray.

Are you including algorithm?
http://dinkumware.com/manuals/default.aspx?manual=compleat&page=algorith.html#sort



Re: namespace std sort function not working by Z

Z
Tue Oct 23 06:23:27 PDT 2007

Thanks a lot, I knew I was missing something.

Z.K.

"Duane Hebert" <spoo@flarn2.com> wrote in message
news:O1oByIQFIHA.4308@TK2MSFTNGP06.phx.gbl...
>
> "Z.K." <nospam@nospam.net> wrote in message
> news:OWiy25PFIHA.5228@TK2MSFTNGP05.phx.gbl...
>>I can seem to get sort to work. I use the using namespace std at the
>>beginning of my program, and sort appears to be there, but when I compile
>>my program, it says sort is not a member of namespace std. I am tryint to
>>use sort to sort a CStringArray.
>
> Are you including algorithm?
> http://dinkumware.com/manuals/default.aspx?manual=compleat&page=algorith.html#sort
>



Re: namespace std sort function not working by Alex

Alex
Tue Oct 23 11:26:04 PDT 2007

"Z.K." wrote:
> I can seem to get sort to work. I use the using namespace
> std at the beginning of my program, and sort appears to be
> there, but when I compile my program, it says sort is not
> a member of namespace std. I am tryint to use sort to sort
> a CStringArray.

In addition to `std::sort' you can use CRT `qsort' function:

KB216858 - "How to use the quick-sort function to sort MFC
CArray-derived classes on the MFC and Visual C++ run-time
library"
http://support.microsoft.com/kb/216858

Alex