- 博客(7)
- 资源 (4)
- 收藏
- 关注
原创 修改的p369-13
//第一个文件 13.h#include #include "13.h"void main(){ char strId[30],strName[30]; int intMath,intEnglish,intC; cout cin>>strId; cout cin>>strName; cout cin>>intMath>>intEnglish>>intC; student s
2006-11-20 13:34:00 889
原创 C++ 修改的p369-17题 数组类
#include class CArray{private: int nSizeofInt; //整型数组的大小 int nNumofInt; //整型数组中实际存放的元素个数 int nSizeofFloat; //浮点数组的大小 int nNumofFloat; //浮点数组中实际存放的元素个数 int *pInt; //指向整型数组,动态分配内存空间 double *pFl
2006-11-20 12:15:00 896
原创 C++ 操作数组的类
#include class CArray{private: int nSizeofInt; //整型数组的大小 int nNumofInt; //整型数组中实际存放的元素个数 int nSizeofFloat; //浮点数组的大小 int nNumofFloat; //浮点数组中实际存放的元素个数 int *pInt; //指向整型数组,动态分配内存空间 float *pFlo
2006-11-19 20:26:00 1335
原创 C++ 16 拷贝字符串
#include #include class Csample{ char *p1,*p2;public: Csample() { p1=new char[20]; p2=new char[20]; } void intit(char *s1,char *s2) { int k; k=strlen(s1); for(int i=0;i { p1[i]=s1[i]; } p1
2006-11-17 18:06:00 571
原创 14 一个求点的类
#include class CPoint{public: CPoint(int intx,int inty) { x=intx; y=inty; } void display() { cout } void setpoint(int intx,int inty) { x=intx; y=inty; }private: int x; int y;};void main(){ CP
2006-11-17 18:05:00 594
原创 C++类之 学生基本情况例子
//有两个文件 一个头文件student.h 一个cpp文件student.cpp//student.h #include #include class score //成绩类{public: score() { math=0; english=0; c=0; } void setmath(int i) //设置数学成绩 { math=i; } void setinte
2006-11-07 20:49:00 1150
原创 c++类计算减法
#include class CTest{public: void init(int inta,int intb) //做减法 { t=inta-intb; } void print() //输出 { cout }private: int t;};void main(){ CTest c; c.init(200,60); c.print();}
2006-11-07 19:37:00 1714
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人