不会写代码的菜鸡程序猿 2017-03-22 12:35 采纳率: 0%
浏览 914

一个c++的问题LNK2001 1120

#include
using namespace std;
const int StackSize=50;
template
class SeqStack
{
public:
SeqStack(){top=-1;}//初始化栈空是栈顶指针为-1
~SeqStack(){}
void Push(DataType x);
DataType Pop();
int Empty(){top=-1?return 1:return 0;}
private:
DataType data[StackSize];
int top;
};
template
void SeqStack::Push(DataType x)
{
if(top==StackSize-1)throw"上溢";
data[top]=x;
++top;
}
template
DataType SeqStack::Pop()
{
if(top==-1)throw"下溢";
x=data[top];
--top;
return x;

}
class change
{
public: int* opertion();
};
template
class two:change
{
public:
int* opertion(int x)
{
int a[50];
SeqStack object;
int i=0;
while(x!=0)
{
object.Push(x%2)
x=x/2;

    }
    while(!object.Empty())
    {
        a[i]=object.pop();

    }
    return a;


}

};
template
int main()
{
int x=16;
two A;
A.opertion(x);
cout<<x;
}

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-03-22 14:59
    关注
     int Empty(){top=-1?return 1:return 0;}
    ->
    int Empty(){
    return top == -1? 1: 0;
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥50 comsol稳态求解器 找不到解,奇异矩阵有1个空方程返回的解不收敛。没有返回所有参数步长;pid控制
  • ¥15 怎么让wx群机器人发送音乐
  • ¥15 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功