here is my code so far
#include <stdio.h> #include <stdlib.h> #include <string.h> int main () { char mainArray[20]; // specify max size of string to be 80 char CopyArray[20];//specify max size of coped arry to be 80 int i=0; // start indexing into array at 0 int j=0; int index1=0; printf("Please enter in a string of character up to 19 characters in length. \n"); //get characters from keyboard until enter key pressed while((mainArray[i] = getchar( )) != '\n' ) { i++; // increment to next location in array } mainArray[i] = '\0'; // NULL termination for string printf("The first string is %s %X.\n",mainArray); //printf("The first string in hex is %x.\n",mainArray); for(index1=i-1; index1>=0; index1--) { CopyArray[j]= mainArray[index1]; j++;//increment to next location in array } CopyArray[j]='\0';// NULL termination for string printf("The second string is %s.\n",CopyArray); { return 0; } }