read and write to a file

I would like to wrte a content of two varible to a file to be read in

void handleRequest(char *request, int request_len)
{
Writ_to_file(request, request_len)
//// some code
}

Inside the above function I would like i call the function "Write_to_file()" in order to write the contents of "request" and "request_len" arguments. So when handleRequest is invoked it first writes the contents of the argument to file in hexadecimal, so could you help how the "Write_to_file()" looks like?

Then I want another function that reads the contents of the file and load it to the two variables again, so I can call the function handleRequest(char *request, int request_len) with the content of the file.

I have done this, but my problem is that when I read the content of the varibles, they are read in string format!! so I can not load them again to the handleRequest function as it accepts char and int!!

Regards
Best bet is to show your code that isn't working properly.

We'll be able to better identify the problem that way.
unfortunately, I deleted the bit of code I did.

what I need is:
To write the two arguments (request, request_len) to a file in hexi
and then read them from the file to be passed again to the function void handleRequest(char *request, int request_len)
That is unfortunate, indeed. Why don't you give it another go and come back with what you've got?
Topic archived. No new replies allowed.