Last active
September 22, 2015 17:39
-
-
Save williamspatrick/9fd3a2f8235991d94bdc to your computer and use it in GitHub Desktop.
designated initializers?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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