所以,我似乎有问题与我的代码堆栈之一。显然,它不会将顶层识别为堆栈的参数之一。请,我需要很多帮助。顶部没有在此范围内声明
#include <iostream>
using namespace std;
int n;
typedef struct {
int content[100];
int top;
} stack;
stack mystack;
int pushstack(stack *somestack, int somevalue) {
if(top+1>=100)
return 1;
(*somestack).top++;
(*somestack).content[(somestack).top]=somevalue;
return 0;
}
难道你不是指'somestack-> top'? – Biffen 2014-09-30 07:31:01