Code:
char line;
int letters;
char display[letters];
//you can't declare an array like this. you either hard code it ( display[255] ), or you research pointers and learn how to use malloc.
printf("enter a line:\n");
scanf("%s", line); // scanf %s will read until you hit enter, but line is a variable that will only store one char, so you need to change this to be scanf("%s", display) because display will hold more than one character.
letters = strlen(line); // the length of one character is one, you need to say strlen(display) if you want the string
while (letters > 0) // you want to print all characters, so while letters >= 0
{
printf("%s", display[letters]);
--letters;
}
return 0;
}
that'll give you a little more direction. however, you might want to pick your variable names better
Example:
you declared the variable line as one character and display as multiple characters. I would have done something like:
char OneChar
char EntireLine[255];
int NumberOfChar;
NumberOfChar = strlen(EntireLine)