pointers strings
===

Im trying to copy a part of string into another string using pointers.  My string begins to copy at the correct place but doesn't stop after the count is reached.  I thought my code should work as follows



1.The 1st for_loop checks if temp array exists and if the start has been reached.  If not, it increments start to the next char and moves temp to the next element.  When the first start char has been reached, this loop should exit and the next for_loop should begin

2.The 2nd for_loop is supposed to make the temp pointer point to the original string points to until the count has been reached.  Then, this loop should exit and the temp pointer points to a null character, terminating the string



    char *GetSub(const char *orig, int start, int count, char *final)
    {    
        char *temp = (char *)orig;
        
        final = temp;
        
        for ( ; *temp && (start > 0) ; )
        {
        	start--;
        	*temp++;
        }
        
        for ( ; *temp && (count > 0) ; count--)
        {
        	*final++ = *temp++;
    	}
        
        *final++ = 0;
        return final;
    }


