First of all strcpy() copies a string, not a char, what you do for your readin routine I have no idear of, since all it seems to be is a while loop that does absolutely nothing.
Something like this will do the trick:
Code:
#include <stdio.h>
#include <string.h>
#define LINE_SIZE 20
int main()
{
char correct_word[LINE_SIZE +1], reverse_word[LINE_SIZE+1];
int i, j;
printf("Please enter word to be reversed: ");
fflush(stdout);
if(!fgets(correct_word, LINE_SIZE, stdin))
{
printf("Error reading word from stdin\n");
return -1;
}
/* correct for teh '\n' and '\0' from the read string */
j = strlen(correct_word) -2;
for(i = 0; j >= 0; )
reverse_word[i++] = correct_word[j--];
/* make sure reversed word isn't ending in garbadge */
reverse_word[i] = '\0';
printf("Read word was: %s", correct_word);
printf("Reversed word: %s\n", reverse_word);
return 0;
}