Skip to content

Instantly share code, notes, and snippets.

@twam
Last active December 11, 2015 21:48
Show Gist options
  • Save twam/4664907 to your computer and use it in GitHub Desktop.
Save twam/4664907 to your computer and use it in GitHub Desktop.
Another way of accessing arrays ;)
#include <stdio.h>
int main(int arc, char **argv) {
double a[2];
unsigned int i = 1;
a[i] = 1.0;
printf("Value after a[i] = 1.0: %lf\n", a[i]);
i[a] = 2.0;
printf("Value after i[a] = 2.0: %lf\n", a[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment