Thread: how to compare two uuids?

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    22

    how to compare two uuids?

    Hi,
    In my program I hv two uuid_t type pointers.
    I want to compare these two.
    How can i do that?

    eg code
    Code:
    int comuuid( uuid_t *uuid1 , uuid_t  *uuid2 )
    {
    // how can i compare the uuid1 and uuid2 (not the pointer value.)
    }
    
    thanks.

  2. #2
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,059
    Depends on what is the typedef of uuid?

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    The obvious way would be to use memcmp.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    Registered User
    Join Date
    Sep 2007
    Posts
    1,012
    If it's the libuuid from e2fsprogs then uuid_compare() is the way to do it. To the OP: check "man 3 uuid" to see the functions available to you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Polynomials and ADT's
    By Emeighty in forum C++ Programming
    Replies: 20
    Last Post: 08-19-2008, 08:32 AM
  2. compare strings not working
    By gtriarhos in forum C Programming
    Replies: 7
    Last Post: 09-29-2005, 12:51 PM
  3. Help Writing My Own String Compare
    By djwicks in forum C Programming
    Replies: 4
    Last Post: 04-07-2005, 09:44 PM
  4. String Compare Using Dynamic Arrays
    By djwicks in forum C Programming
    Replies: 4
    Last Post: 03-31-2005, 08:01 PM
  5. Compare files
    By LKH in forum C Programming
    Replies: 13
    Last Post: 04-10-2004, 07:09 PM