
    #include <iostream>
    #include <cstring>
    
    int main()
    {
    	char str[] = "Hello, my name is John";
    	size_t len = strlen(str);
    	size_t change_position = 0;

        // find the first space character
    	for (change_position = 0; change_position < len; ++change_position)
    		if (str[change_position] == ' ')
    			break;  // found it

      
    	if (change_position != len)  // if we found a space character
    	{
    		for (size_t check_position = change_position; check_position < len; ++check_position)
    			if (str[check_position] != ' ')
    			{
    				str[change_position] = str[check_position];
    				++change_position;
    			}
    	}
    	str[change_position] = '\0';
    	std::cout << str;
    }

