#include <stdio.h> #include <string.h> int main(int argc, char** argv) { char* p = argv[1]; //get the first argument char* q = p + strlen(p) - 1; char t; while(*p != 'A') { p++; } while(*q != 'A') { q--; } while(p < q){ t = *p; *p = *q; *q = t; printf("%c - %c: %s\n",*p,*q,argv[1]); p++; q--; } /* printf("%s",q); */ return (q - argv[1]); }