#include <iostream>
#include <string>
using namespace std;
int main()
{
string a;
cout<< "enter string" <<endl;
cin>> a;
string b;
//========================================================
for (int j=a.size(); j>0; j--)
{
for (int i=0; i<a.size(); i++)
{
b[j]=a[i];
}
}
cout<< b <<endl;
return 0;
}
i want the first character on string a to be the last char on string b up until the last on a is the first on b. what is the problem in that cycle?
ps: it runs and causes an illegal error table.