Last active
December 11, 2015 21:48
-
-
Save twam/4664907 to your computer and use it in GitHub Desktop.
Another way of accessing arrays ;)
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
#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