I've been trying to figure what I'm doing wrong all day. I'm becoming discouraged. Can anyone help me out?
void stripSpace(string &str) {
int i,j,len=str.length();
for (i=0;j=0;i<len;i++;j++)
if (str[j]==' ') {
str.erase(j,1);
j--;
}
str[j]='\0';
}
I just won't seem to stop until I get this fixed!!!! Any help would be appreciated. It compiles alright, but when I run the main program the string is not cout'd.
Thanks in advanced, Lamabot