plz improve my function that reverses a const char*
i was asked this in a job interview, not entirely sure they liked my answer. They asked me what if it were sent a wchar_t* and i couldnt answer what would happen. should i also check the pointer is not null first?

    const char* reverse(const char* inString)
    {
    	int length = strlen(inString);
	    char* returnThis = new char;
	    for(int i = 0; i<length; i++)
	    {
	    	returnThis[i]=inString[length-i-1];
	    }
	    return returnThis;
    }


    int main (int argc, char * const argv[]) 
    {
	    const char* thing = "ahem";
	    const char* reverseThing = reverse(thing);
	    std::cout << reverseThing << std::endl;
	    delete reverseThing;
	
        return 0;
    }
plz improve my function that reverses a const char*
===

i was asked this in a job interview, not entirely sure they liked my answer. They asked me what if it were sent a wchar_t* and i couldnt answer what would happen. should i also check the pointer is not null first?

    const char* reverse(const char* inString)
    {
    	int length = strlen(inString);
	    char* returnThis = new char;
	    for(int i = 0; i<length; i++)
	    {
	    	returnThis[i]=inString[length-i-1];
	    }
	    return returnThis;
    }


    int main (int argc, char * const argv[]) 
    {
	    const char* thing = "ahem";
	    const char* reverseThing = reverse(thing);
	    std::cout << reverseThing << std::endl;
	    delete reverseThing;
	
        return 0;
    }