Hi ,
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?

Hi,
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.

Er, so where ARE you putting the result?

If it isn't to a block of memory, or to a file, what's the point?

Hi,
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.

Er, that's what "memory" is.

As in say char myEncodedXDRDataGoesInHere[100];