string comparison, help!

Discussion in 'C++' started by Al-Burak, Dec 11, 2005.

  1. Al-Burak

    Al-Burak Guest

    How does one compares two char pointers in 'C', for instance, lets say
    that I want to know if cp1 is less, equal, or grater than cp2?


    TIA
     
    Al-Burak, Dec 11, 2005
    #1
    1. Advertisements

  2. Al-Burak wrote:
    > How does one compares two char pointers in 'C',


    By asking a question in relavent group like comp.lang.c or by looking
    up in a relavent book or searching on the net.

    >for instance, lets say that I want to know if cp1 is less, equal, or grater than cp2?


    char *x, *y;
    //....
    x<y; // true if x is less than y.

    But why would you want to compare _poiner_s?
     
    Neelesh Bodas, Dec 11, 2005
    #2
    1. Advertisements

  3. Al-Burak

    Al-Burak Guest

    Oops! sorry. I clicked in the wrong group..

    :(
     
    Al-Burak, Dec 11, 2005
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason
    Replies:
    2
    Views:
    28,237
    Phil Hanna
    Sep 20, 2003
  2. grz02

    Java String comparison

    grz02, Feb 23, 2005, in forum: Java
    Replies:
    40
    Views:
    16,093
    nooobody
    Mar 5, 2005
  3. Keith
    Replies:
    8
    Views:
    3,989
  4. Dankwart Plattner

    Strange string comparison result

    Dankwart Plattner, Aug 21, 2004, in forum: XML
    Replies:
    4
    Views:
    570
    Dankwart
    Aug 27, 2004
  5. Replies:
    21
    Views:
    1,700
    Alex Vinokur
    Aug 18, 2007
  6. Smithers
    Replies:
    12
    Views:
    1,422
    Ben Voigt [C++ MVP]
    Jul 7, 2009
  7. Joey Martin

    Help with exact string comparison

    Joey Martin, Mar 3, 2009, in forum: ASP General
    Replies:
    1
    Views:
    228
    Evertjan.
    Mar 3, 2009
  8. Deepu
    Replies:
    1
    Views:
    442
    ccc31807
    Feb 7, 2011
Loading...