注册 登录
编程论坛 数据结构与算法

新学的类c语言,好头疼啊

XYP14350 发布于 2015-04-08 10:43, 2217 次点击
#include<stdio.h>
#define LIST_INIT_SIZE  100
#define LISTINCREMENT   10
#include<malloc.h>
void * malloc(unsigned size);
typedef struct{
    ElemType  * elem;
    int length;
    int listsize;
}SqList;
status InitList_Sq(SqList &L){
    L.elem = (ElemType * )malloc(LIST_INIT_SIZE * sizeof(ElemType));
    if(!L.elem)exit(OVERFLOW);
    L.length=0;
    L.listsize =LIST_INIT_SIZE;
    return OK;
}//InitList_Sq
int main(void)
{
    printf("%s",malloc);
}
这是我从书上集合编写的.cpp格式的编程,是关于线性表的顺序表的插入操作。。。
可是。。。我也不知道自己在写什么!
2 回复
#2
T_MACC2015-05-12 10:05
书上是这样讲的吗   
只定义一个空的线性表  
况且还少一句
 typedef int ElemType;
typedef int Status;
#3
wp2319572015-05-13 15:06
加油
1