| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 854 人关注过本帖
标题:C语言 问题 求大神
取消只看楼主 加入收藏
青衣秀锦年
Rank: 1
来 自:湖北武汉
等 级:新手上路
帖 子:15
专家分:0
注 册:2011-12-5
结帖率:33.33%
收藏
已结贴  问题点数:10 回复次数:2 
C语言 问题 求大神
#include<stdio.h>
#include<stdlib.h>
#include <malloc.h>
#define False 0
#define True 1
#define Null 0
#define maxsize 20
#define maxvertexnum 20
typedef struct node{
    int adjvex;
    struct node *next;
}edgenode;

typedef struct {
    char vertex;
    edgenode *link;
}vexnode,AdjList[maxvertexnum];

typedef struct{
AdjList adjlist;
int n,e;
}Graph;
typedef struct{
    int *data;
    int *top;
}seqstack;
vexnode g[maxvertexnum];
int visited[maxvertexnum];
void CreatAdjList(Graph &G){
    int i,j,k;
    edgenode *s;
    char c;
    printf("please input the set points and the number of edges:\n");
     scanf("%d,%d",&G.n,&G.e);
     c=getchar();
    printf("please input vertex information ( vertex number ):\n");
    for(i=1;i<=G.n;i++){
        printf("The %d vertices",i);
        scanf("%c",&G.adjlist[i].vertex);
        c=getchar();
        G.adjlist[i].link=NULL;
    }
    printf("please input the edge information():\n");
    for(k=1;k<=G.e;k++){
        printf("please enter please input %d edges starting vertex number:\n",k);
        scanf("%d",&i);
        printf("please enter please input %d edges with a vertex number:\n",k);
        scanf("%d",&j);
        s=(edgenode*)malloc(sizeof(edgenode));
        s->adjvex=j;
        s->next=G.adjlist[i].link;
        G.adjlist[i].link=s;
    }
} 为什么总提示 unable to open include file "MALLOC.H"
搜索更多相关主题的帖子: False C语言 include 
2011-12-05 10:33
青衣秀锦年
Rank: 1
来 自:湖北武汉
等 级:新手上路
帖 子:15
专家分:0
注 册:2011-12-5
收藏
得分:0 
回复 3楼 gaochizhen33
真心 在那里找那个文件  哎...路径在哪里啊?
2011-12-05 12:02
青衣秀锦年
Rank: 1
来 自:湖北武汉
等 级:新手上路
帖 子:15
专家分:0
注 册:2011-12-5
收藏
得分:0 
回复 5楼 hellovfp
我用的是TC  如果找不到那个文件 该怎么样处理了 真心不知道了
2011-12-05 13:37
快速回复:C语言 问题 求大神
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013436 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved