C
csmith8933
I'm trying to loop until the string length is 0, deleting one
character at a time. This doesnt work for obvious reasons I'm sure.
string s;
s = "0000011111";
while (s.length() > 0)
{
functionOne(s);
}
string functionOne(string str)
{
cout << str << endl;
if (str.length() > 0)
{
str.erase(0, 1);
return str;
}
}
character at a time. This doesnt work for obvious reasons I'm sure.
string s;
s = "0000011111";
while (s.length() > 0)
{
functionOne(s);
}
string functionOne(string str)
{
cout << str << endl;
if (str.length() > 0)
{
str.erase(0, 1);
return str;
}
}