Forked from graymalkin/gist:44d4cad04aca968b21c4
Last active
August 29, 2015 14:05
-
-
Save egelmex/dc4c5717242f1567971d 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> | |
int main(int argc, char* argv[]) | |
{ | |
char* i = 0; | |
char* str = "Hello, World"; | |
for(i = str + 11; i >= str; i--) | |
putchar((char)*i); | |
return 0; | |
} | |
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 argc, char* argv[]) | |
{ | |
if(argc <= 1) | |
return 1; | |
char* i = 0; | |
char* str = argv[1]; | |
for(i = str + strlen(str); i >= str; i--) | |
putchar((char)*i); | |
return 0; | |
} | |
int | |
strlen(char *str) | |
{ | |
int i; | |
for (i = 0; str[i] != '\0'; ++i) {} | |
return i; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment