int GetLastWordLength(char* str){ int len=strlen(str); int i=0; while(*(str+len-1-i)!=' '){ i++; } return i; }