Skip to content

Instantly share code, notes, and snippets.

@irondoge
Created July 8, 2016 19:05
Show Gist options
  • Select an option

  • Save irondoge/22c46bc3d528433c67e15bbee2921dcc to your computer and use it in GitHub Desktop.

Select an option

Save irondoge/22c46bc3d528433c67e15bbee2921dcc to your computer and use it in GitHub Desktop.
array definition by range [compilation: gcc -W -Wall -Wextra -std=c89 range.c]
#include <stdio.h>
int main()
{
int omg[10] = { [0 ... 4] = 42, [5 ... 9] = 10 };
printf("%d", omg[3]);
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment