#define BS 1000
XDR *xdrs;
char buf1[BS];
xdrmem_create(xdrs,buf1,BS,XDR_ENCODE);
I followed what the text book said but whenever I ran my program, it has segmentation fault. I开发者_StackOverflow think there is problem with xdrmem_create. Has anybody here been successful when using this function?
(I'm using Ubuntu 10.10)
You didn't initialize the pointer. Fix:
XDR stream;
xdrmem_create(&stream, buf1, BS, XDR_ENCODE);
精彩评论