Thread: alphabetize string compare function

  1. #1
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459

    alphabetize string compare function

    Before I go through the trouble of creating a function which would do this, is there a function in <string.h> which would do this for me? It'd save me a lot of trouble. And I don't have my C: TCR right now, nor help files, so if anyone knows offhand it'd be appreciated.
    hasafraggin shizigishin oppashigger...

  2. #2
    Registered User
    Join Date
    May 2002
    Posts
    13
    I think you would have to write your own...it wouldn't be that hard though. Happy Coding
    "Computer Science is no more about computers than astronomy is about telescopes"
    - E.W. Dijkstra

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    194
    strcmp() compares two strings

    #include <string.h>
    int strcmp( const char *str1, const char *str2 );



    The function strcmp() compares str1 and str2, then returns:

    Return value Explanation
    less than 0 str1 is less than str2
    equal to 0 str1 is equal to str2
    greater than 0 str1 is greater than str2

    All this is from http://www.cppreference.com/

  4. #4
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    Thank you.
    hasafraggin shizigishin oppashigger...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Inheritance Hierarchy for a Package class
    By twickre in forum C++ Programming
    Replies: 7
    Last Post: 12-08-2007, 04:13 PM
  3. String issues
    By The_professor in forum C++ Programming
    Replies: 7
    Last Post: 06-12-2007, 09:11 AM
  4. Replies: 6
    Last Post: 04-21-2006, 08:49 PM
  5. qt help
    By Unregistered in forum Linux Programming
    Replies: 1
    Last Post: 04-20-2002, 09:51 AM