Reversing the string starting with that character would give you your string reversed, but the null terminating zero would be at strrev[0] so when you printed it you wouldn't see anything.
That was exactly my problem! Thanks!
I did:
Code:
#include <stdio.h>
#include <string.h>
int main(void)
{
char str[80], backwards[80];
int i,x=0;
printf("Enter a string: ");
fgets(str, sizeof(str), stdin);
for (i = (strlen(str) - 1); i>=0; i--,x++)
{
backwards[x]=str[i];
}
backwards[x] = '\0';
printf("%s", backwards);
return 0;
}