高手赐教!不惜高分!不够再加!
不才,写了个整形常量的+,-,*,/,(,)运算符号的四则简单的混合运算。可是,怎么调试,也没有结果,请指教。具体算法是依据,严魏民的《数据结构》里的栈的实现中 的算法!原代码如下:
//////////////////////////////////函数包含////////////////////////////////////////////////////
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <iostream.h>
#include <string.h>
#include <ctype.h>
/////////////////////////////////定义数据类型,常量/////////////////////////////////////////
typedef int STATUS;
typedef char * string;
typedef struct {
double * Base;
double * Top;
int Size;
}STACK;
typedef struct {
char * Base;
char * Top;
int Size;
}STACKC;
///////////////////////////
#define TRUE 1
#define WRONG 0
#define SUCCES 1
#define FALSE 0
//////////////////////////
#define INITSIZE 50
#define INCREMENTSIZE 10
//////////////////////////////////////////////InitStack()/////////////////////////////////////
STATUS
InitStack(STACK * pStack)
{
(*pStack).Base=new double[INITSIZE];//malloc
if((*pStack).Base==NULL){return FALSE;}
(*pStack).Size=INITSIZE;
(*pStack).Top=(*pStack).Base;
return SUCCES;
}//End ( )