Tuesday, October 2, 2007

C++ struct initialization

---- / from boost.asio example / ----
struct mapping
{
const char* extension;
const char* mime_type;
} mappings[] =
{
{ "gif", "image/gif" },
{ "htm", "text/html" },
{ "html", "text/html" },
{ "jpg", "image/jpeg" },
{ "png", "image/png" },
{ "swf", "application/x-shockwave-flash" },
{ 0, 0 } // Marks end of list.
};