#include<stdio.h>
#include<stdlib.h>
#include<string>
using namespace std;
void _trimStr(char* head, char* newhead, char* str){
int len = strlen(str);
if(head == str + len) {
*newhead = '/0';
return;
}
if(*head == ' ') _trimStr(++head,newhead,str);
else{
*newhead = *head;
_trimStr(++head,++newhead,str);
}
}
void trimStr(char* str){
_trimStr(str,str,str);
}
int main(){
string sp = " s df df ss e ";
char * p = (char *)(sp.c_str());
trimStr(p);
printf("%s",p);
system("pause");
}