一个C语言程序的问题

来源:百度知道 编辑:UC知道 时间:2024/05/21 15:00:33
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define OVERFLOW -2
#define OK 1

typedef int status;

typedef struct{
int x;
int y;
}postype;

typedef struct{
int ord;
postype seat;
int di;
}selemtype;

typedef struct{
int m[10][10];
postype start,end;
}mazetype;

typedef struct{
selemtype *base;
selemtype *top;
int stacksize;
}sqstack;

mazetype maze={{ {0,0,0,0,0,0,0,0,0,0},
{0,1,1,0,1,1,1,0,1,0},
{0,1,1,0,1,1,1,0,1,0},
{0,1,1,1,1,0,0,1,1,0},
{0,1,1,1,1,0,0,0,0,0},
{0,1,1,1,0,1,1,1,1,0},
{0,1,0,1,1,1,0,1,1,0},
{0,1,0,0,0,1,0,0,1,0},
{0,0,1,1,1,1,1,1,1,0},
{0,0,0,0,0,0,0,0,0,0}},{1,1},{8,8}};

status initstack(sqstack *s)
{
s->base=(selemtype*)malloc(100 * sizeof(selemtyp

如下修改后无任何语法或链接问题
main()
{
//clrscr();
mazepath();
}

下面是我的代码:(同一本书,我C++版的,请参考,如果有数据结构方面的问题我们可以一起讨论)
凡是喜欢数学或编程都是我的朋友!
//Migong.h
/////////////////////////
/////////迷宫求解////////
//////作者:baihacker//////
/////时间:11.10.2006/////
/////////////////////////
/*class:
Matrix:矩阵类
offsets:搜索偏移
enum directions:四个方向
struct item:搜索节点
Migong:迷宫类
1.创建一个Migong对象
2.使用用Create方法输入数据
3.使用Solve方法进行求解
4.ShowSolve方法显示解
5.可以重复使用Create方法
6.入口只能在左上角
7.默认出口在右下角
ShowAllPath:穷举所有的路径
备注:
由于算法原因,这里的所有路径应该是指
介于:
a.如果两条路存在某个点不同那么就是不同的路
b.如果在一条路中去掉一个或者一个以上的圈,那么他们是同一条路
之间意义上的路
*/
#include <iostream>
#include <stack>
#include <vector>

using namespace std;

#ifndef MIGONG_H
#define MIGONG_H
///////////////////
///////矩阵类//////
/////////////