#include <iostream>
#include <string>
using namespace std;
class Person {
public:char *m_name;int m_age;int m_id;Person() {cout << "默认构造函数" << endl;const char * name "default";m_name new char[strlen(name)…
先看 普通菱形继承
#include <iostream>
#include <string>
using namespace std;
class Animal {int a_age;
};
class Sheep : public Animal {};
class Tuo : public Animal {};
class SheepTuo : public Sheep, public Tuo {};
void test1() {cout << …
文章没有解释和代码注释,代码经改进,做成了好理解,关键是好记忆的方式进行书写。用于自己进行查阅
#include <stdio.h>void merge(int arr1[],int left ,int mid ,int right)
{int temp[sizeof(arr1)];int i left ;int j mid 1;int t 0;while…