warning C4700:local variable 'l' used without having been initialized
warning C4700:local variable 'l' used without having been initialized
#include "stdio.h"
#include "stdlib.h"
#define ERROR 0
#define ok 1
#define OVERFLOW -2
#define list_init_size 100//線性表存儲空間的初始分配量
#define listincrement 10//線性表存儲空間分配增量
typedef int status;
typedef int elemtype;//類型定義
typedef struct{
elemtype *elem;//存儲空間基址
int length;//當前長度
int listsize;//當前分配的存儲容量 (以sizeof(ElemType)為單位)
}sqlist;
status Initlist(sqlist l,int list_number)
{if(list_number>list_init_size) return ERROR;
l.elem=(elemtype*)malloc(list_number*sizeof(elemtype));
if(!l.elem) exit(OVERFLOW);
l.length=0;
l.listsize=list_number;
return ok;
}
//在線性表中插入一個元素
status listinsert_sq(sqlist l,int i,elemtype e )//構(gòu)造一個空線性表L
{/*在順序線性表L中的第i個位置之前插入新的元素e
i的合法值為1=q;--p) *(p+1)=*p;//插入位置及之后的元素后移
*q=e;
++l.length;
return ok;
}
void outputlist(sqlist l)
{int j;
for(j=0;j
#include "stdio.h"
#include "stdlib.h"
#define ERROR 0
#define ok 1
#define OVERFLOW -2
#define list_init_size 100//線性表存儲空間的初始分配量
#define listincrement 10//線性表存儲空間分配增量
typedef int status;
typedef int elemtype;//類型定義
typedef struct{
elemtype *elem;//存儲空間基址
int length;//當前長度
int listsize;//當前分配的存儲容量 (以sizeof(ElemType)為單位)
}sqlist;
status Initlist(sqlist l,int list_number)
{if(list_number>list_init_size) return ERROR;
l.elem=(elemtype*)malloc(list_number*sizeof(elemtype));
if(!l.elem) exit(OVERFLOW);
l.length=0;
l.listsize=list_number;
return ok;
}
//在線性表中插入一個元素
status listinsert_sq(sqlist l,int i,elemtype e )//構(gòu)造一個空線性表L
{/*在順序線性表L中的第i個位置之前插入新的元素e
i的合法值為1=q;--p) *(p+1)=*p;//插入位置及之后的元素后移
*q=e;
++l.length;
return ok;
}
void outputlist(sqlist l)
{int j;
for(j=0;j
其他人氣:535 ℃時間:2020-02-03 00:02:44
優(yōu)質(zhì)解答
你的main函數(shù)中的l變量應(yīng)作為全局變量,放在最最開始的那幾行,在執(zhí)行完函數(shù)時的過程中,l中三元素的值當然會變,但執(zhí)行完,l就有返回執(zhí)行前的狀態(tài)了,函數(shù)在執(zhí)行時會為括號中的各個參數(shù)創(chuàng)建一塊空間,但執(zhí)行完畢之后就會自...
我來回答
類似推薦
- warning C4700: local variable 'x' used without having been initialized 求高手解釋
- 但是定義了之后又有提示warning C4700:local variable 'count' used without having been initialized
- 已知0<x<1那么在x,x分之一,根號x,x的2次冪中最大的數(shù)是
- Fe和HCl反應(yīng)為什么比稀H2SO4快?解釋一下CL-怎么催化而使其更快放出H2的?
- 配方法解題
- 實驗室里電解1千克水電流大概做功多少焦?
- 英語作文,my new teachers,很急
- 1.We must make some _____ (決定) for the coming trip.
- 自行車輪胎的外直徑是95limi,如果這輛自行車平均每分鐘轉(zhuǎn)120圈.那么自行車10分鐘能否通過3600米長的大橋
- 設(shè) 數(shù)列{X}有界,又limy=0 證明 limxy=0
- 若向量a、b滿足|a|=|b|=1,|3a-2b|=√7,則|3a+b|=?
- 如圖,在△ABC中,∠C=90°,∠CAB與∠CBA的平分線相交于O點,求∠AOB的度數(shù).
猜你喜歡
- 1花兒為什么這樣紅中六個說明花紅的原因可以顛倒么?為什么?
- 2一堆木料,底層有37根,上面一層比下面一層少1根,最上層有25根,這堆木料有多少根?求列式
- 3已知函數(shù)y={log2 x-2}{log4x-1/2}2《《8
- 4宇宙和世界分別是什么概念?
- 5已知-m+2n=5,那么3(m-2n)^2+10n-5m-23?
- 6李師傅加工一批零件,每天加工15個,12天完成.如果每天加工18個,多少天完成?用方程解
- 7客貨兩車分別從東西兩城同時出發(fā),相向而行,經(jīng)過9小時相遇.相遇后兩車繼續(xù)向前行駛,客車7小時到達西城
- 8一桶油連桶帶油重28千克,用去一半后連桶帶油重21千克.問油多少,桶多少?
- 9英語故事英文怎么寫
- 10一道小學(xué)語文標點符號的練習(xí)題
- 11為什么現(xiàn)代類人猿不能進化成人類
- 12汪國真的《生活》