Comparing two GUIDs for equality in C ++

I am looking for the easiest way to compare two GUIDs for equality in C ++. Of course, there is a predefined function for this.

The solution should work with Visual C ++ 2010.

Update:

I am talking about a GUID as defined in Guiddef.h:

typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[ 8 ]; } GUID; 
+4
source share
2 answers

Maybe you want IsEqualGUID (which uses memcmp behind the scenes) or just use operator== (which calls IsEqualGUID for you).

+10
source

The == operator is not overloaded to do this for you? Or use IsEqualGUID .

+2
source

All Articles