c++和java不一样的。。
登录 | 论坛导航 -> 华新鲜事 -> 社会百科 | 本帖共有 1 楼,分 1 页, 当前显示第 1 页 : 本帖树形列表 : 刷新 : 返回上一页
<<始页  [1]  末页>>
作者:hula (等级:7 - 出类拔萃,发帖:3686) 发表:2003-06-29 18:28:25  楼主  关注此帖
VC++里面,Stack怎么写?我写了个,好多错! 帮忙看看! //tristStack.h #ifndef _TRISTSTACK_H_INCLUDE #define _TRISTSTACK_H_INCLUDE #include "Trist.h" class tristStack { public: tristStack(); ~tristStack(); void pushTrist (Trist t); Trist popTrist (); bool isEmpty(); int getSize(); Trist head; tristStack next; int size; }; #endif //tristStack.cpp #include "tristStack.h" tristStack::tristStack() { head = null; next = null; size=0; } tristStack::~tristStack() { } bool tristStack::isEmpty () { if (size == 0) return true; return false; } int tristStack::getSize() { return size; } void tristStack::pushTrist(Trist t){ next = this; head = t; size++; } Trist tristStack::popTrist() { Trist temp = head; head = next.head; next = next.next; size--; return temp; } //error message when built --------------------Configuration: Delaunay2D - Win32 Debug-------------------- Compiling... computeDT.cpp d:\urop\myproj\delaunayvisualiser\delaunay2d\triststack.h(19) : error C24 (more...)
c++和java不一样的。。
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版所有回复从这里展开收起列表
论坛导航 -> 华新鲜事 -> 社会百科 | 返回上一页 | 本主题共有 1 篇文章,分 1 页, 当前显示第 1 页 | 回到顶部
<<始页  [1]  末页>>

请登录后回复:帐号   密码