I am trying to use XDR to encode an integer variable.
I am trying to use xdr_int function xdr_int(&xdrs, &i); But to use this function I have to set XDR_ENCODE somewhere. I am unable to go about how to do this.
How should I proceed?
The 2 functions which use XDR_ENCODE are
xdrmem_create and xdrstdio_create
But I am unable to use them with xdr_int because xdrmem_create deals with a chunk of memory & xdrstdio_create deals with stdout.
I am storing it to a variable & then writing that variable to a file in the later part of the code.
I cannot write it immediately to a file.
Is there no way to encode & store it in a variable?
Thanks for your time.