Skip to content

Instantly share code, notes, and snippets.

@amyreese
Created May 10, 2014 20:31
Show Gist options
  • Save amyreese/f26a46ea058afbd68e9e to your computer and use it in GitHub Desktop.
Save amyreese/f26a46ea058afbd68e9e to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int length = 5;
int test_array[] = {21,14,35,63,28};
int main(int argc, char* argv[])
{
for (int i = 0; i < length; i++)
{
printf("%d: %d\n", i, test_array[i]);
}
return 0;
}
@amyreese
Copy link
Author

On linux:

$ gcc -o foo foo.cpp && ./foo
0: 21
1: 14
2: 35
3: 63
4: 28

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