开发者

xdrmem_create segmentation fault

#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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜