I have been working on this very simple question. I am trying to reverse a array of chars and then store this reversed array of chars into another array using c language. Here is my code, I can not figure out what is the problem of my code. I really do not understand why when I try to print out my stcp which is the array with the reversed string, there is nothing show up on the screen. Please advice, any help would be really appreciate.
#include<stdio.h>
int main() {
char st[100];
scanf("%s", st);
int count = 0;
while(st[count] != '\0'){
count++;
}
//printf("%s", st);
char stcp[100];
int i, j = 0;
for(i = count-1; i >= 0; i--){
st[i] = stcp[j];
j++;
}
puts(stcp);
return 0;
}