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. Advertising

  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. Advertising

  3. Al-Burak

    Al-Burak Guest

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

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

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:
    27,943
    Phil Hanna
    Sep 20, 2003
  2. Replies:
    21
    Views:
    1,453
    Alex Vinokur
    Aug 18, 2007
  3. Smithers
    Replies:
    12
    Views:
    1,207
    Ben Voigt [C++ MVP]
    Jul 7, 2009
  4. Joey Martin

    Help with exact string comparison

    Joey Martin, Mar 3, 2009, in forum: ASP General
    Replies:
    1
    Views:
    167
    Evertjan.
    Mar 3, 2009
  5. Deepu
    Replies:
    1
    Views:
    266
    ccc31807
    Feb 7, 2011
Loading...

Share This Page