Results 1 to 2 of 2

Thread: Sorting by given name

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2006
    Posts
    719

    Sorting by given name

    Code:
    #include<iostream.h>
    #include<conio.h>
    static const char*brothers[]={
         "Frederick William",
         "Joseph Jensen",
         "Harry Alan",
         "Walter Ellsworth",
         "Julian Paul"
         };
       extern "C" void SortCharArray(const char**);
       extern"C"{
          int SizeArray(void)
          {
          return sizeof brothers/sizeof(char*);
          }
          }
          #define SortCharArray;
          main()
          {
           clrscr();
           SortCharArray(brothers);
           int size=SizeArray();
           for(char i=0; i<size; i++)
           cout<<'\n'<< brothers[i];
           getche();
    }
    The code was not able to sort the given names from the array. How can I modify the program so that it will sort the given names?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Sorting by given name

    Moved From The CodeBank

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width