Last active
June 11, 2016 12:53
-
-
Save jmkim/7f3b5aceacd08fc6e2a2170986d10ec2 to your computer and use it in GitHub Desktop.
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
int i; | |
int var[] = { 1, 3, 2, 4, 6, 5 }; | |
int * varptr = var; | |
int odd = 0, nonodd = 0; | |
for(i = 0; i < sizeof(var) / sizeof(int); ++i) | |
(*(varptr + i) % 2 == 0) ? nonodd += *(varptr + i) : odd += *(varptr + i); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment