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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.