i am making a server-client program in which they are exchanging keys of a hash chain. the keys being generated are in uint32_t, however when i exchange these keys between server-client, i have to send them using write(). here problem is that write() transfer data in string format only, therefore before sending i have to convert uint32_t to string using sprintf and then transmit. at reciever side i have to convert back into uint32_t. but i am unable to do so; as per me there are 2 solutions for this.
- either send data using write() in uint32_t format only. i dont how to do it.
- or use a function which can convert uint32_t to char and vice versa. this also i am not aware of.
if any one can provide solution to my problem, i will be grateful to him.