Last active
December 12, 2018 15:39
-
-
Save uucidl/5c0308f42d76cb2193a34a1e6ca10165 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
#include <stdio.h> | |
// Shows how to iterate backwards in C. (Counter version) | |
int main(int argc, char** argv) | |
{ | |
{ int c = argc; while (c--) { | |
printf("%s%s", argv[c], c == 0 ? "\n" : ", "); | |
} } | |
} |
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> | |
// Shows how to iterate backwards in C. (Ptr version) | |
int main(int argc, char** argv) | |
{ | |
{ char** f = argv; char** c = f+argc; while (c-- != f) { | |
printf("%s%s", *c, c == f ? "\n" : ", "); | |
} } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment