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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

C語(yǔ)言模擬數(shù)組時(shí)遇到的問(wèn)題,編譯無(wú)誤,但無(wú)輸出

C語(yǔ)言模擬數(shù)組時(shí)遇到的問(wèn)題,編譯無(wú)誤,但無(wú)輸出

# include <stdio.h># include <malloc.h>void inint(struct Arrylist *,int);//bool add(struct Arrylist *, int, int);//bool del(struct Arrylist *, int, int);bool reverse(struct Arrylist *);bool show(struct Arrylist *);//bool is_empty(struct Arrylist *);//bool is_full(struct Arrylist *);//bool append(struct Arrylist *, int);struct Arrylist{ int * p;//the address of the first element of the arrylist int con;//the real element number of the arrylist int len;//the max of the length of the arrylist};int main(void){ struct Arrylist * ay; inint(ay, 6); append(ay, 1); append(ay, 2); append(ay, 3); show(ay); return 0;}bool is_full(struct Arrylist * arry)//judge a arry is full or not{ if(arry->con == arry->len) { return true; } else { return false; }}bool show(struct Arrylist * arry)// to show the arry{ if( is_empty(arry) ) { printf("The arrylist is empty!\n"); return false; } for(int i = 0; i < arry->con-1; i++) { printf("show the arry :%d", (arry->p)[i]); } return true;}void inint(struct Arrylist * arry, int len)//inintilization the arry{ arry->p = (int *)malloc(sizeof(int)*len); arry->con = 0; arry->len=len; return;}bool append(struct Arrylist * arry, int val){ if( is_full(arry) ) { printf("the arry is full!\n"); return false; } arry->p[arry->con-1] = val; arry->con++; return true;}bool is_empty(struct Arrylist * arry)//judege whether a arry is empty or not{ if(arry->con == 0) { return true; } else { return false; }}bool add(struct Arrylist * arry, int pos, int val)//add element{ if(is_full(arry)) { printf("Arrylist is full!"); return false;? } else if(pos < 1 || pos > arry->con+1) { printf("Wrong add!"); return false; } else { for(int i = arry->con; i > pos; i--) { (arry->p)[i-1] = (arry->p)[i-2]; } (arry->p)[pos-1] = val; arry->con++; return true; }}
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 1047 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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