第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

這個(gè)是什么問(wèn)題亞

部分代碼:(主要是這里有問(wèn)題)

#define USERINFO_FILE?????????????????? "/home/ocelot/pmm/data/info.txt"
//用戶(hù)信息表記錄文檔路徑

#define SAVES_HOME_PATH???????????????? "/home/ocelot/pmm/data/"

#define _STRUCT_USER_INFO_SIZE????????? (sizeof(struct user_info))
//struct user_info類(lèi)型結(jié)構(gòu)體大小

#define _END_LOOP?????????????????????? "$!END_0"

extern struct user_info * getUserInfo()
{
??????? FILE *fp = fopen(USERINFO_FILE,"r");

??????? //若文件不存在,則返回空指針
??????? if(fp == NULL)
??????????????? return NULL;

??????? char??? buf[64];??????????????? //緩沖字符串
??????? int???? user_num = 0;?????????? //用戶(hù)數(shù)量

??????? //獲取用戶(hù)數(shù)量
??????? while(fscanf(fp,"%s",buf) != EOF)
??????? {
??????????????? if(buf[0] == '[')
??????????????????????? user_num++;
??????? }

??????? struct user_info??????? *pi = (struct user_info *)malloc(_STRUCT_USER_INFO_SIZE * (user_num+1));
??????? //動(dòng)態(tài)分配結(jié)構(gòu)體數(shù)組
??????? fclose(fp);

??????? FILE *fp_s = fopen(USERINFO_FILE,"r");
??????? //若文件不存在,則返回空指針
??????? if(fp == NULL)
??????????????? return NULL;

??????? int???? serial = 0;???????????? //讀入的用戶(hù)序號(hào)
??????? while(fscanf(fp_s,"%s",buf) != EOF)
??????? {
??????????????? //忽略注釋行
??????????????? if(buf[0] == '#')
??????????????????????? continue;
??????????????? //將Name存入數(shù)組
??????????????? if(buf[0] == '[')
??????????????????????? serial++;

if(buf[0] == 'N')
??????????????? {
??????????????????????? printf("##%s##\n",buf);
??????????????????????? //指向下一個(gè)用戶(hù)
??????????????????????? strcpy(pi->name,//getStrPointStr(buf,':')
??????????????????????????????????????? buf);
??????????????????????? pi+=(_STRUCT_USER_INFO_SIZE * 1);
??????????????? }
??????????????? //將Pw存入數(shù)組
??????????????? else if(buf[0] == 'P')
??????????????? {
??????????????????????? sprintf(pi->pw,"%s",getStrPointStr(buf,':'));
??????????????? }
??????????????? //忽略其他屬性
??????????????? else
??????????????????????? continue;
??????? }

??????? //設(shè)定結(jié)束標(biāo)志
??????? pi+=(_STRUCT_USER_INFO_SIZE * 1);
??????? sprintf(pi->name,"%s",_END_LOOP);
??????? sprintf(pi->pw,"%s",_END_LOOP);

??????? pi-=(_STRUCT_USER_INFO_SIZE * serial);
??????? //將結(jié)構(gòu)體指針指向第一個(gè)用戶(hù)

??????? fclose(fp_s);
??????? return pi;
}

輸出:

##Name:ocelot##
##Name:whisper##
##Name:xiaoyue##
##Name:xiaoyue##
##Name:xiaoyue##
##Name:xiaoyue##
##Name:xiaoyue##
登錄:
用戶(hù)列表:
[1]?? ?9??U
[2]?? ?Name:xiaoyue
[3]?? ?Name:xiaoyue
[4]?? ?Name:xiaoyue
[5]?? ?Name:xiaoyue
[6]?? ?Name:xiaoyue
[7]?? ?

改了很多次,還是有問(wèn)題

但用戶(hù)數(shù)量小于等于3個(gè)時(shí)不會(huì)有這種情況,不知道為什么


正在回答

2 回答

看判斷那兒是不是不對(duì)

0 回復(fù) 有任何疑惑可以回復(fù)我~

編碼就不對(duì)了吧

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

這個(gè)是什么問(wèn)題亞

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)