how to compare two uuids?

This is a discussion on how to compare two uuids? within the C Programming forums, part of the General Programming Boards category; Hi, In my program I hv two uuid_t type pointers. I want to compare these two. How can i do ...

  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,047
    Depends on what is the typedef of uuid?

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,308
    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
    cas
    cas is offline
    Registered User
    Join Date
    Sep 2007
    Posts
    993
    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, 07:01 PM
  5. Compare files
    By LKH in forum C Programming
    Replies: 13
    Last Post: 04-10-2004, 07:09 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21