Skip to content

Instantly share code, notes, and snippets.

@williamspatrick
Last active September 22, 2015 17:39
Show Gist options
  • Save williamspatrick/9fd3a2f8235991d94bdc to your computer and use it in GitHub Desktop.
Save williamspatrick/9fd3a2f8235991d94bdc to your computer and use it in GitHub Desktop.
designated initializers?
using namespace std;
#include <iostream>
#include <stdint.h>
struct foo
{
int x;
int y;
};
int main(int argc, char** argv)
{
foo i = { .y = 6, .x = 2 };
cout << i.x << " " << i.y << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment