Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- char reversedStr[101] = "";
- int count = 0;
- void reverse(char []);
- int main(int argc, char **argv){
- for(int i = argc - 1; i >= 0;i--){
- reverse(argv[i]);
- printf("%s\n", reversedStr);
- strcpy(reversedStr, "");
- }
- return 0;
- }
- void reverse(char input[]){
- for(int j = strlen(input) - 1; j >= 0 ; j--){
- reversedStr[count] = input[j];
- count++;
- }
- reversedStr[count] = '\0';
- count = 0;
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement