Im working on a program and one of the functions writes data to a socket. Everything is working except one part that Im having trouble figuring out.
If I create a variable and assign a hex value to it inside the program everything works. (e.g. char variable[] = '\xff\xff\xff\xff\xff'). But if I put the hex in a file and have the program read it from the file into char variable[] then it doesn't work.
Now what happens is the first way gets written to the socket as hex (how I want it.) but the second way gets written to the network as ascii (how I don't want it.). Now whats confusing to me is that they both are stored in the same variable just in different ways.
So how can I specify to the write function, to write my data as hex instead of ascii to the socket?