L是什么,结构体吗,L.elem又是啥 还有L.length,谢谢好心人

typedef struct
{
int *elem;
int length;
int listsize;
}SqList;

int InitList_Sq(SqList &L)
{
L.elem=(ElemType*)malloc(LIST_INIT_SIZE*sizeof(ElemType));
if(!L.elem)
return ERROR;
L.length=0;
L.listsize=LIST_INIT_SIZE;
return OK;
}
请帮帮忙,我谢过大侠啦

SqList &L 是函数 InitList_Sq() 的形参。L 是 SqList 型结构,&L 表示“引用".
L.elem 里的 L 就是形参 SqList &L 里的 L。
SqList 型结构 在函数前面已定义,它含有3个成员变量,elem 是 int *elem; 也就是指向整型量的指针。所以 L.elem 是指针。
L.elem=(ElemType*)malloc ... 这是动态分配内存,分配后 成员 elem 可以当数组使用。
if(!L.elem) -- 如果 动态分配内存 失败,则...

具体调用 函数 InitList_Sq 时,形参L 用实参代替。L.elem 变 实参.elem ,再动态分配...
温馨提示:答案为网友推荐,仅供参考
第1个回答  2011-09-19
L是一个结构体(不是一个指向结构体的指针哟).....L.elem是一个指针,指向一个整型数据,L.length是一个整型数据..
第2个回答  2011-09-20
(Reporter intern Li Xin Xue Wen) "director of her own,griffey shoes, feelings of confusion to many people who have the obligation to help,air griffey max 1 Fresh water, so really good measure of social benefits." Yesterday, the 68-year-old retired teachers in Yanan recommended a special "Lei Feng." Jin Gao is a lawyer, practicing for many years,air griffey max 1 black, opened his own firm. But the teacher said this is not the main industry, but shes a "sideline" - Public Lecture marriage and family law. According to Temple,jordans heels, who lives in Yanan Backstreets teacher introduced in March 2009, she heard a high-Jin lawyers offer a free marriage and large lecture hall, specifically for having marital problems, emotional confusion of people declared method argument. Because the court of the jury itself,cheap griffey shoes, but also a volunteer Womens Federation, was the message at the beginning of the teacher is interested in,king griffey shoes, then went to the lectures. class, high-Jin in contact with their own true story to tell you how to run their feelings, solve problems and how to correct, finish and leave enough time for lectures free to ask questions of people, and 11 to answer. One class down,new ken griffey shoes, the teacher felt very useful, then people began to recognize recommendation. Since then, the first Sunday of each month, the teacher has a fixed "work",jordan boots, that is, a large lecture hall to listen,ken griffey jr shoes, but is no longer the one to go, but a few people who need help and listen with . Of these, a pair of octogenarian old couple let the teacher memories. Although married for many years, but trouble always less than the old couple together, and often some trivial quarrel or fight, and lead to separation, one of whom moved to her daughter lives. After I heard the teacher,nike heels shoes, took them to a large lecture hall. In the free exchange of time, the old man down to the high-Jin grievances. Jin Gao listening analysis, and no essential differences between an old married couple, after separation will be concerned about each other, just because there is no proper communication, the life unpleasant in some small accumulation into contradictions. So, she did not simply judged right or wrong, but rather to set a number of scenarios to introduce the best approach. "Now the old couple reconciled, and the U.S. United States passed a new year." The teacher said the old man later said,women griffeys, "So did not get along so difficult to imagine ah." the teacher believes that life, most people will have emotional problems, but not everyone has the right to talk, consult the object, and this free large lecture hall, very professional,ken griffey sneakers, there is no threshold for vulnerable groups are particularly good, coupled with long-term exposure to high-Jin marriage and family class cases, can often be more effective proposals to solve the problem. "This has always been my strong suit, do not bother people can help, why not?" That the teacher recommended themselves as the "Lei Feng", high-Jin somewhat unexpected. "Even if true than for the Lei Feng, and should not be me, but our team." Jin said high, a large lecture hall has been opened more than 800 people listening, involving preparation of legal marriage, domestic violence The reality of rights approach,nike air max nm, etc., from the beginning of a tentative start, and now growing in confidence, it is because really help to some people, all word of mouth,ken griffey shoes, not only listening to more and more people every time, but also attracted a number of caring and sense of justice of volunteers to join, the consensus is: "As long as people need,kids griffey shoes, we will continue to do so."
第3个回答  2011-09-20
L就是你上面声明的结构体的引用...L.XX是你调用里面的变量..
相似回答