Skip to content

Instantly share code, notes, and snippets.

@lettergram
Created March 18, 2015 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lettergram/0cbcb263fdec8c02c089 to your computer and use it in GitHub Desktop.
Save lettergram/0cbcb263fdec8c02c089 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(){
unsigned int size = 12;
char str[] = "Hello, Worms!";
char temp;
int i = 0;
for( i = 0; i < size/2; i++ ){
temp = str[i];
str[i] = str[size - i];
str[size - i] = temp;
}
printf("%s\n", str);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment