Skip to content

Instantly share code, notes, and snippets.

@Miliox
Last active August 29, 2015 14:25
Show Gist options
  • Select an option

  • Save Miliox/d3c55177ae0c7abac6b8 to your computer and use it in GitHub Desktop.

Select an option

Save Miliox/d3c55177ae0c7abac6b8 to your computer and use it in GitHub Desktop.
guid to cout
std::ostream& operator<<(std::ostream& os, REFGUID guid)
{
char buffer[37];
snprintf(buffer, sizeof(buffer),
"%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX",
guid.Data1, guid.Data2, guid.Data3,
guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
return os << buffer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment