I commented by the last line. I am trying to print out the string in reverse.
#include <iostream>
using namespace std;
void add(string n);
int main()
{
string B ="ABCDEF";
add(B);
}
void add(string n)
{
if(n.length() <= 1)
{
cout<<n[0]<<endl;
return;
}
else
{
cout<<n[n.length()-1];
add(n[n.length()-1]); //this lines does not work cannot covert char to string
}
}