Thread: String help

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    1

    String help

    How would I put a string in alphabetical order
    thaks moe

  2. #2
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    How would you personally put a list of numbers in order? That ought to give you an idea.

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    1

    String

    You could use ascii values for the characters to order them, but first you must switch all the characters to the same case.

  4. #4
    Registered User abrege's Avatar
    Join Date
    Nov 2002
    Posts
    369
    bubble sort?

    Code:
    for(a=1; a<size; a++)
    {
         for(b=size-1; b>=a; b--)
         {
              t = string[b-1];
              string[b-1] = string[b];
              string[b] = t;
          }
    }
    EDIT: wait...no *slaps himself in forehead*
    I am against the teaching of evolution in schools. I am also against widespread
    literacy and the refrigeration of food.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. compare structures
    By lazyme in forum C++ Programming
    Replies: 15
    Last Post: 05-28-2009, 02:40 AM
  2. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  4. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM