回文章列表
作者edwardc.bbs@dragon.seed.net.tw (情人的眼淚), 信區: firebird
標題Re: 請問如何抓出好友名單??
時間種子網 BBS (Thu Jan 21 20:59:51 1999)
轉信站: GIBBS!egg.mm.ntut!dragon
Origin: dragon.seed.net.tw

【 在 oversample (sigma-delta) 的大作中提到: 】
: 我想列出好友名單內的人名, 所以仿了 getfriendstr 這個
: 程式寫了一個, 但都列不出來, 請問是哪ㄦ出錯了, 好友個
: 數是對的, 但人名都是空字串...:(  請問我有弄錯那了嗎?
: main()
: {
: struct override *tmp;
: int i;
: int fnum;
: char genbuf[STRLEN*2];
  ^^^^^^^^^^^^^^^^^^^^^^
:    fnum=get_num_records("friends",sizeof(struct override));
:     if(fnum<=0)
:         return 0;
:     fnum=(fnum>=MAXFRIENDS)?MAXFRIENDS:fnum;
:     tmp=(struct override *)calloc(sizeof(struct override),fnum);
:     get_records(genbuf,tmp,sizeof(struct override),1,fnum);
                  ^^^^^^
        我不清楚你的程式前後是怎樣, 但是我不清楚這個 genbuf 是怎麼來的

        我想你應該自己可以用個 fread() 來寫一個 .. 不需要仿 src 裡面的

--
LEO (July 23 - Aug 22)
        You consider yourself a born leader.  Others you think you are
        pushy.  Most Leo people are bullies.  You are vain and dislike
        honest criticism.  Your arrogance is disgusting.  Leo people
        are thieves.

※ 來源:‧種子網 BBS dragon.seed.net.tw‧[FROM: ccc.seed.net.tw]
文章選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻