pesky pointer problems...

BigusDickus:

You would need char ** or a reference.

Thanks Wildbill, I'm not being lazy here but could you please be a little more explicit about how to get this working, I've only just got my head around pointers(*) and addresses(&) and I'm not sure what char** means (is this a pointer to a pointer?). I've already spent some time expereimenting with char** but haven't got anything to work.

Or, just keep the original function as is and return null if the phone number is not found.

This is in fact what I've done, just to get my project working, but being a pig-headed so-and-so I'd still like to get the d4mn function to work!

Just be careful to distinguish between the address-of operator '&' and the reference declarator '&' - the first means "take the address of this variable", the latter means "this argument is to be passed by reference and in the body of the function access it via the supplied reference (in other words its not a local variable, its an "alias" for the variable passed in the call).