摘要: 将一个整数插入到一个有序的数组并输出 插值 阅读全文
posted @ 2021-08-06 09:51 卿源 阅读(649) 评论(0) 推荐(0)
摘要: #include<stdio.h> #define N 15 int Search_array(int array[],int n,int value) { int low=0; int high=n-1; int mid; while(low<=high) { mid=(low+high)/2; 阅读全文
posted @ 2021-08-06 09:01 卿源 阅读(73) 评论(0) 推荐(0)
摘要: variable-sized object may not be initialized  报错的原因 创建数组的时候不要对其进行初始化 阅读全文
posted @ 2021-08-02 10:00 卿源 阅读(7885) 评论(2) 推荐(0)
摘要: 类模板与函数模板的区别 类模板与函数模板 阅读全文
posted @ 2021-07-29 11:02 卿源 阅读(210) 评论(0) 推荐(0)
摘要: 类模板: 指定多个类型的T(现举两个) template<class typename,class typeage,class...> eg:创建一个Person类 class person { public: person(typename name,typeage age) { this->na 阅读全文
posted @ 2021-07-29 10:31 卿源 阅读(67) 评论(0) 推荐(0)
摘要: 1、"+"运算符重载: 1 #include<iostream> 2 using namespace std; 3 class Person 4 { 5 public: 6 int m_A; 7 int m_B; 8 //成员函数运算符重载 9 Person operator+(Person& p) 阅读全文
posted @ 2021-07-22 17:26 卿源 阅读(94) 评论(0) 推荐(0)
摘要: 1 #include<iostream> 2 using namespace std; 3 //创建一个Person类 4 class Person 5 { 6 public: 7 Person(int age1, string name1) 8 { 9 this->age = age1; 10 t 阅读全文
posted @ 2021-07-22 16:56 卿源 阅读(105) 评论(0) 推荐(0)