摘要: #include #include using namespace std; class Student1 { int no; char *pname; public: Student1(){};//默认构造函数 Student1(int n,char *p)//重载构造函数 { no=n; pname=new char[10];//不用new分配空间时会出错 strcpy(pname,p); ... 阅读全文
posted @ 2013-05-22 21:49 herizai 阅读(162) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-05-22 21:35 herizai 阅读(2) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-05-22 13:31 herizai 阅读(1) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-05-22 12:56 herizai 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 用c的方式实现栈用C++数据抽象的方式实现栈#include<stdio.h>structstruct Stack{};void StackInit(struct Stack* stack){stack->head=NULL;stack->size=0;}void StackPush(structStack*stack,const int data){struct Link* node;node=(struct Link*)malloc(sizeof(struct Link));assert(node!=NULL);node->data=data;node-> 阅读全文
posted @ 2013-05-22 12:52 herizai 阅读(110) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-05-22 11:44 herizai 阅读(4) 评论(0) 推荐(0) 编辑