class crunode
{
public:
CString text;
int level;
}class CStack
{
public:
crunode stack[100]; // 栈
public:
CString pop();
}// 出栈
CString CStack::pop()
{
return stack[tail--].text;
}在delphi里面,我把它改成下面的代码:type
crunode = class
public:
text: string ;
level: integer;
end; Stack = class(crunode);
public:
stack: array[0...100]of crunode;
public:
function pop:string;
end; function Stack.pop;
begin
tail := tail - 1;
result := stack[tail+1].text;
~~~~~~~~~~~~~~~~~~~~~~在这里会出错的,,,为什么???
end;
请问,如果我这样有问题,,那怎样修改才对呢???多谢。
{
public:
CString text;
int level;
}class CStack
{
public:
crunode stack[100]; // 栈
public:
CString pop();
}// 出栈
CString CStack::pop()
{
return stack[tail--].text;
}在delphi里面,我把它改成下面的代码:type
crunode = class
public:
text: string ;
level: integer;
end; Stack = class(crunode);
public:
stack: array[0...100]of crunode;
public:
function pop:string;
end; function Stack.pop;
begin
tail := tail - 1;
result := stack[tail+1].text;
~~~~~~~~~~~~~~~~~~~~~~在这里会出错的,,,为什么???
end;
请问,如果我这样有问题,,那怎样修改才对呢???多谢。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货