FILE to String data types

Hi,
I am trying to read a FILE data type into a String data type, I tried to make the FILE* veriable just equal the String veriable but i get:

Conversion from 'FILE*' to 'String' is ambiguous

Has anyone got any idea?

Thanks

It seems like you are starting out in C. If you explain exactly what you need to do, we can help. Showing what you think works is not going to help us at all. ...I'm guessing this has to do with your other post.

stdio is not C++, just C. stdio does not have these gee-whiz overloading things that convert = into whatever the programmer thinks it ought to be. In trying to put a FILE * into a string you're trying to put the file pointer itself into a string, not the file contents. To access data with a FILE *, you MUST use the stdio functions.

Basically i have a fork and a execl i need to send the output of the execl instead of onto the screen, into a variable. I need to do this as the need to send it over a socket.

dup allows you to close the fd for stdout, then redirect it to your socket fd.