会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
bobo哥
博客园
首页
新随笔
联系
管理
订阅
上一页
1
···
10
11
12
13
14
15
16
17
18
···
54
下一页
2020年12月28日
c++基类和派生类的框架
摘要: 源程序: #include <iostream>using namespace std;class Point //基类,也叫父类{protected: int x,y;public: Point(int a,int b) { x=a; y=b; } void show() { cout<<"x="
阅读全文
posted @ 2020-12-28 19:31 bobo哥
阅读(145)
评论(0)
推荐(0)
2020年12月27日
从文件读入7个数并排序
摘要: 源程序: #include <iostream>#include <iomanip>using namespace std;int main(){ int x,i,j,arr[7]; freopen("d:\\cccccc\\input.txt","r",stdin); for(i=0;i<7;i+
阅读全文
posted @ 2020-12-27 20:13 bobo哥
阅读(95)
评论(0)
推荐(0)
2020年12月15日
字符串复制函数-简单
摘要: #include <stdio.h>#include <stdlib.h>#include <string.h>void StringCopy(char* strSource, char* strDestination){ int i = 0; while(*strSource!='\0') { *
阅读全文
posted @ 2020-12-15 22:23 bobo哥
阅读(637)
评论(0)
推荐(0)
c++函数模板-简单
摘要: 源程序: #include <iostream>using namespace std; class CCount //定义类CCount{public: CCount(void); //构造函数 ~CCount(void); //析构函数 int GetCount(void); //成员函数 vo
阅读全文
posted @ 2020-12-15 21:19 bobo哥
阅读(191)
评论(0)
推荐(0)
用初始化列表解决常私有变量问题-简单
摘要: 源程序: #include <iostream>using namespace std; //定义类的模板class A //类的定义{private: int x,y; const int z;public: //A(){}; //缺省的构造函数 A(int a,int b,int c):x(a)
阅读全文
posted @ 2020-12-15 21:06 bobo哥
阅读(121)
评论(0)
推荐(0)
分配和释放内存-简单
摘要: 源程序: #include <stdio.h>#include <string.h>#include <malloc.h> char *GetMemory(int num){ char *p=(char *)malloc(sizeof(char)*num); return p;} void main
阅读全文
posted @ 2020-12-15 20:48 bobo哥
阅读(117)
评论(0)
推荐(0)
结构体小程序-简单
摘要: 源程序: #include <stdio.h>#include <malloc.h> struct Student //结构体{ int sid; //学号 int age; //年龄}; struct Student *CreateStudent(){ struct Student *stu=(s
阅读全文
posted @ 2020-12-15 20:40 bobo哥
阅读(219)
评论(0)
推荐(0)
字符串copy-简单
摘要: 源程序: #include <stdio.h>#include <stdlib.h>#include <string.h>void StringCopy(char *strSource,char *strDestination){ int i; for(i=0;strSource[i]!='\0';
阅读全文
posted @ 2020-12-15 19:43 bobo哥
阅读(149)
评论(0)
推荐(0)
一个简单的c++程序--关注程序结构
摘要: 源程序: #include <iostream>using namespace std; class Test{private: int Width,Height;public: //以下是函数 void SetValue(int iWidth,int iHeight) { Width=iWidth
阅读全文
posted @ 2020-12-15 19:11 bobo哥
阅读(113)
评论(0)
推荐(0)
2020年12月14日
一个关于字符串的c语言程序
摘要: 源程序: #include <stdio.h>#include <string.h> int main(){ char str[20]; int length; length=strlen(strcpy(str,"Hello World!")); printf("字符串长度:%d\n",length
阅读全文
posted @ 2020-12-14 21:30 bobo哥
阅读(154)
评论(0)
推荐(0)
上一页
1
···
10
11
12
13
14
15
16
17
18
···
54
下一页
公告