I must be doing something wrong because i keep getting junk when i try to output this cstring.
#include <iostream>
#include <cstring>
using namespace std;
int main(){
char word[20];
char word_new[20];
int len;
cout << "Please enter a word now." << endl;
cin.getline(word, 20);
cout << word << endl;
len = strlen(word);
cout << len << endl;
for (int i = 0; i <= len - 1; i++){
for (int j = len - 1; j >= 0; j--){
word[j] = word_new[i];
cout << word_new[i] << endl;
}
}
for (int count = 0; count < len - 1; count++){
cout << word_new[count];
}
cout << "" << endl;
return 0;
}
First time posting here. Thank you