biluochun2010
biluochun2010

Reputation: 119

How to generate GUID using standard c++?

In standard c++, how to generate GUID?

In windows, I know I have API to create. But I would like to be platform independent, is there a way?

Upvotes: 2

Views: 1719

Answers (1)

Christophe
Christophe

Reputation: 73376

The GUID refers to Microsoft's implementation of the Universal Unique IDentifier (UUID) defined by RFC 4122.

So for the Microsoft implementation there is no portable way to generate it: it's windows API. It's 16 bytes as UUID, but there are some differences in the byte order.

But if you are looking for UUID, boost provides a portable implementation.

Upvotes: 2

Related Questions