Q:

Pass-by-reference in C - downsides?

Most high-level languages (Python, Ruby, even Java) use pass-by reference.  Obviously, we don't have references in C, but we can imitate them using pointers.  There are a few benefits to doing this.  For example:
int findChar(char ch, char* in)
{
    int i = 0;
    for(i = 0; in[i] != '\0'; i++)
        if(in[i] == ch)
            return i;
    return -1;
}

This is a common C paradigm: catch an abnormal or erroneous situation by returning some error value (in this case, return -1 if the character is not in the string).
The problem with this is: what if you want to support strings more than 2^31 - 1 characters long?  The obvious solution is to return an unsigned int but that won't work with this error value.
The solution is something like this:
unsigned int* findChar(char ch, char* in)
{
    unsigned int i = 0;
    for(i = 0; in[i] != '\0'; i++)
        if(in[i] == ch)
        {
            unsigned int index = (unsigned int*) malloc(sizeof(unsigned int));
            *index = i;
            return index;
        }
    return NULL;
}

There are some obvious optimizations which I didn't make for simplicity's sake, but you get the idea; return NULL as your error value.
If you do this with all your functions, you should also pass your arguments in as pointers, so that you can pass the results of one function to the arguments of another.
Are there any downsides to this approach (besides memory usage) that I'm missing?
EDIT: I'd like to add (if it isn't completely obvious by my question) that I've got some experience in C++, but I'm pretty much a complete beginner at C.

A:

It is a bad idea because caller is responsible to free the index, otherwise you are leaking memory. Alternatively you can use static int and return its address every time - there will be no leaks, but function becomes non-reentrant, which is risky (but acceptable if you bear it in mind).
Much better would be to return pointer to char function finds, or NULL if it is not present. That's the way strchr() works, BTW.
Edited to reflect changes in original post.

A:

Without the malloc, the position can be still a stack variable and you can use it in an if statement:
int findChar(char ch, char* in, int* pos)
{
    int i = 0;
    for(i = 0; in[i] != '\0'; i++) 
    {
        if(in[i] == ch) 
        {
            *pos = i;
            return 1;
        }
    }

    return 0;
}

