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!!
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)