void my_string::reverse()
{
int counter=0;
while (ptr[counter]!='\0') //no {} for the while
counter++;
for (int i=0;i<(counter/2);i++)
{
char tmp=ptr[i];
ptr[i]==ptr[counter];
ptr[counter]==tmp;
counter--;
}
}
it should be:
1 2 3 4 5 6 7 8 9 10 11
while (ptr[counter]!='\0') //no {} for the while
{
counter++;
for (int i=0;i<(counter/2);i++)
{
char tmp=ptr[i];
ptr[i]==ptr[counter];
ptr[counter]==tmp;
counter--;
}
}