Skip to content

Instantly share code, notes, and snippets.

@eatnumber1
Created October 28, 2013 09:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eatnumber1/7193665 to your computer and use it in GitHub Desktop.
Save eatnumber1/7193665 to your computer and use it in GitHub Desktop.
An example of the use of VLA's in structs. A GNU C extension.
int main() {
int n = 1;
struct foo {
char a;
int b[n];
};
struct foo a;
a.a = 'a';
a.b[0] = 1;
n = 2;
struct foo b;
b.a = 'b';
b.b[0] = 1;
b.b[1] = 2;
}
@firegurafiku
Copy link

Thank you for illustrating the concept. Now let me unsee it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment