from Ivor Horton [Beginning Visual C++ 2008]
#include<iostream>
using std::cout;
using std::endl;
void eatspaces(char* str);
int main(){
char ch[] ="12 * 2.3 - 3.4+ 5.6";
eatspaces(ch);
cout << ch <<endl;
return 0;
}
void eatspaces(char* str)
{
int i=0,j=0;
while((*(str+i)=*(str+j++))!='\0')
{
if(*(str+i)!=' ')
{
i++;
}
}
}