when the error message pops up the istream library opens and an arrow points to
this line
*_Str++ = _Traits::to_char_type(_Meta); // add it to string how can I fix this
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
char *word;
cout<<"Enter aword with no spaces : ";
cin >> word;
cout << "Your word is: "<< word << "\nYour reversed word is: ";
int size = strlen(word)-1;
while (size >= 0)
{
cout << word[size];
size--;
Looks like you're trying to make a c style string, but didn't quite make it. All you did was make a pointer of type char, and then try to assign some input to it. I'd recommend to just use the string class, considering this is c++ you're using
that got rid of the unhandled exception but this line became problematic
int size = strlen(word)-1;
so I changed it to
int size = word.length;
that didnt help