【C++】C++类和对象详解(上)

news2024/9/21 20:36:41

目录

思维导图大纲:

 思维方面:

 1.  类的定义:

2.  类的特点:

 3.  this指针:

4.  类的默认成员函数 

 默认构造函数

 1.构造函数 

  2.析构函数

 3.拷贝构造函数

4. 赋值运算符重载 

1. 运算符重载

5. 日期类实现:

Date.h 

Date.cpp

Text.cpp 


思维导图大纲:

 思维方面:

思维方面:由面向过程转化为面向对象
我们造一辆车,我们需要金属框架,轮胎,玻璃窗,发动机等等
面向过程:我们去自己造金属框架,轮胎,玻璃窗,发动机等等,然后组装
面向对象:我们自己不造以上配件,我们直接组装 

 1.  类的定义:

1. C语言中的struct结构体
我们只能在其中放变量
更改更方便的名字需要借助typedef

typedef struct Stack
{
	int* array;
	int capacity;
	int size;
}Stack;

2. C++中的class类
我们可以在其中存放变量,我们将这些变量叫做成员变量
成员变量前最好加_下划线来区分
我们还可以存放函数,我们将这些函数叫做成员函数
我们不用使用typedef直接使用类名 

class Stack
{
	// 成员函数
	
	// 初始化
	void Init();
	// 销毁
	void Destroy();


	// 成员变量
	int* _array;
	int _capacity;
	int _size;
};

2.  类的特点:

  (1) 类域
 我们之前了解了命名空间域,全局域,局部域
 在类里面也被类域保护,声明和定义分离时需要表明

class Stack
{
	// 成员函数

	// 声明在内
	// 初始化
	void Init(int n = 4);
	// 销毁
	void Destroy();


	// 成员变量
	int* _array;
	int _capacity;
	int _size;
};

// 定义在外
// 需要使用Stack::声明类域
void Stack::Init(int n)
{
	_array = (int*)malloc(sizeof(int) * n);
	if (_array == nullptr)
	{
		perror("malloc fail!");
		return;
	}

	_capacity = n;
	_size = 0;
}

 (2)访问限定符
 我们知道类的成员函数和成员变量属于类域内,当我们主函数去调用时访问权限不够
 类的默认权限为私有——private
 类的三大权限:public-公有,private—私有,protect-保护
 想要访问类需要将权限改为公有,但默认我们不去修改类的成员变量,所以我们只将成员函数设为公有 

class Stack
{
public:
	// 成员函数
	// 初始化
	void Init(int n = 4)
	{
		_array = (int*)malloc(sizeof(int) * n);
		if (_array == nullptr)
		{
			perror("malloc fail!");
			return;
		}

		_capacity = n;
		_size = 0;
	}

	// 销毁
	void Destroy()
	{
		free(_array);
		_array = nullptr;
		_capacity = 0;
		_size = 0;
	}

private:
	// 成员变量
	int* _array;
	int _capacity;
	int _size;
};

类的实列化:
前面的类只是声明,我们需要定义-即开空间
说人话就是:前面的类就好比一张图纸,我们实例化就是根据这张图纸建筑房子
类和对象的关系是:一对多,一张图纸可以盖很多很多相同的房子 

int main()
{
	// 类的实列化
	Stack st;
	st.Init();
	st.Destroy();

	return 0;
}

对象的大小计算和c语言的结构体的内存对齐规则一模一样
首先我们的类中的成员函数会被多次调用,不同的对象都会去调用,所以我们为了节省空间
不将成员函数放在类中存储,我们将成员函数放在公共区域
类中存储的只有成员变量
类内部没有成员变量的,只有成员函数或者什么都没有默认给一个字节用于对象占位标识,表示存在 

class A
{
public:
	void Print()
	{
		cout << "void Print()" << endl;
	}

private:
	char _a;
	int _b;
	double _c;
};

class B
{
public:
	void Print()
	{
		cout << "void Print()" << endl;
	}
};

class C
{};

class D
{
public:
	void Print()
	{
		cout << "void Print()" << endl;
	}
private:
	A _d;
	int _e;
};

int main()
{
	// 实例化
	A a;
	B b;
	C c;
	D d;

	// 输出大小
	cout << sizeof(a) << endl;
	cout << sizeof(b) << endl;
	cout << sizeof(c) << endl;
	cout << sizeof(d) << endl;

	return 0;
}

 

 3.  this指针:

不存放在类,存放在栈,有些编译器也存放在寄存器中

class Date
{
public:

	/*void Init(Date* this, int year = 1949, int month = 1, int day = 1)
	{
		this->_year = year;
		this->_month = month;
		this->_day = day;
	}*/

	void Init(int year = 1949, int month = 1, int day = 1)
	{
		_year = year;
		_month = month;
		_day = day;
	}

	/*void Print()
	{
		cout << this->_year << "/" << this->_month << "/" << this->_day << endl;
	}*/

	void Print()
	{
		cout << _year << "/" << _month << "/" << _day << endl;
	}
private:
	int _year;
	int _month;
	int _day;
};

int main()
{
	// 我们定义两个对象进行初始化
	Date d1;
	Date d2;
	d1.Init(2024, 7, 11);
	d2.Init(2024, 8, 1);

	d1.Print();
	d2.Print();

	// 为什么调用同一个函数,但是却给不同对象初始化不同值,这边也没传地址啊?
	// 其实默认传了地址,并且使用this指针对不同的对象进行了初始化
	// 但是this指针不可以显示成为参数,可以在函数内部显示使用和返回

	return 0;
}

考察理解this指针的题目 

class A
{
public:
	void Print()
	{
		cout << "void Print()" << endl;
	}
private:
	int _a;
};

class B
{
public:
	void Print()
	{
		cout << "void Print()" << endl;
		cout << this->_a << endl;
	}
private:
	int _a;
};

int main()
{
	A* a = nullptr;
	a->Print();

	B* b = nullptr;
	b->Print();

	// 以上两个程序语句分别是1.报错,2.运行崩溃,3.成功运行?
	
	return 0;
}

 类A只是传过去nullptr但是this没有进行解引用和访问操作所以程序成功运行。

类B传过去nullptr并且进行了访问操作所以程序崩溃。

4.  类的默认成员函数 

什么是默认成员函数,简单说我们不去实现,编译器也会默认生成这些成员函数 

 默认构造函数

 下面以栈类介绍类的默认函数

 1.构造函数 


 函数名与类名一样,无返回值
 全缺省构造函数
 我们不自己实现构造函数,编译器会默认生成一个无参构造函数,这个函数对内置类型不做处理,对自定义类型会去调用他们的构造函数
 无参构造函数,全缺省构造函数,编译器默认生成的无参构造函数都可以称作为默认构造,不传参即可调用的构造为默认构造
 无参构造函数,全缺省构造函数,编译器默认生成的无参构造函数三者只能存在一个
 相当于Stack中的Init

class Stack
{
public:
	// 无参构造函数
	/*Stack()
	{
		cout << "Stack():无参构造" << endl;
		_array = (int*)malloc(sizeof(int) * 4);
		if (nullptr == _array)
		{
			perror("malloc fail!");
			exit(-1);
		}

		_capacity = 4;
		_size = 0;
	}*/

	// 全缺省构造函数
	Stack(int n = 4)
	{
		cout << "Stack():全缺省构造函数" << endl;
		_array = (int*)malloc(sizeof(int) * n);
		if (nullptr == _array)
		{
			perror("malloc fail!");
			exit(-1);
		}

		_capacity = n;
		_size = 0;
	}
private:
	int* _array;
	int _capacity;
	int _size;
};

int main()
{
	Stack st;

	return 0;
}

  2.析构函数


 函数名与类名一样,但是需要在最前面加上~取反符号,无返回值
 析构函数我们不去实现编译器也会自动默认生成,
 对于动态内存申请的空间我们需要自己实现析构函数手动释放
 对于没有动态申请的类,我们不用实现析构函数,编译器默认生成的析构函数即可完成

// 析构函数
~Stack()
{
	cout << "~Stack()::析构函数" << endl;
	free(_array);
	_array = nullptr;
	_capacity = _size = 0;
}

 3.拷贝构造函数


 拷贝构造函数是构造函数的重载,函数一致,参数不同
 对于表面的值拷贝属于浅拷贝,我们不用实现,编译器自动生成的即可
 对于像栈一类的拷贝属于深拷贝,我们需要自己实现,另外开辟空间,将值拷贝到新的空间上 

	// 拷贝构造函数
	Stack(const Stack& s) // 使用const修饰放在修改来源
	{
		cout << "Stack(const Stack& s)::拷贝构造函数" << endl;
		_array = (int*)malloc(sizeof(int) * s._capacity);
		if (nullptr == _array)
		{
			perror("malloc fail!");
			exit(-1);
		}

		memcpy(_array, s._array, sizeof(int) * s._capacity);
		_capacity = s._capacity;
		_size = s._size;
	}

4. 赋值运算符重载 

1. 运算符重载

• 当运算符被⽤于类类型的对象时,C++语⾔允许我们通过运算符重载的形式指定新的含义。C++规定类类型对象使⽤运算符时,必须转换成调⽤对应运算符重载,若没有对应的运算符重载,则会编译报错。

• 运算符重载是具有特名字的函数,他的名字是由operator和后⾯要定义的运算符共同构成。和其他函数⼀样,它也具有其返回类型和参数列表以及函数体。

• 重载运算符函数的参数个数和该运算符作⽤的运算对象数量⼀样多。⼀元运算符有⼀个参数,⼆元运算符有两个参数,⼆元运算符的左侧运算对象传给第⼀个参数,右侧运算对象传给第⼆个参数。

• 如果⼀个重载运算符函数是成员函数,则它的第⼀个运算对象默认传给隐式的this指针,因此运算符重载作为成员函数时,参数⽐运算对象少⼀个。

• 运算符重载以后,其优先级和结合性与对应的内置类型运算符保持⼀致。

• 不能通过连接语法中没有的符号来创建新的操作符:⽐如operator@

.*    ::    sizeof     ?:     .

• 注意以上5个运算符不能重载。

• 重载操作符⾄少有⼀个类类型参数,不能通过运算符重载改变内置类型对象的含义,如: int

operator+(int x, int y)

• ⼀个类需要重载哪些运算符,是看哪些运算符重载后有意义,⽐如Date类重载operator-就有意义,但是重载operator+就没有意义。

 • 重载++运算符时,有前置++和后置++,运算符重载函数名都是operator++,⽆法很好的区分。C++规定,后置++重载时,增加⼀个int形参,跟前置++构成函数重载,⽅便区分。 

5. 日期类实现:

在日期类实现当中,我们会去应用类的默认构造函数,以及运算符重载

Date.h 

#pragma once
#include <iostream>
#include <stdbool.h>

using namespace std;

class Date
{
public:
	// 日期类默认构造函数
	Date(int year = 1949, int month = 10, int day = 1);

	// 没有资源申请不用实现析构函数
	// ~Date();

	// 打印日期
	void Print();

	// 日期类拷贝构造函数
	Date(const Date& d);

	// 获取某日期的天数
	int GetMonthDay(const Date& d)
	{
		static int arr_day[13] = { -1,31,28,31,30,31,30,31,31,30,31,30,31 };

		if (d._month == 2 && ((d._year % 4 == 0) && (d._year % 100 != 0) || (d._year % 400 == 0)))
		{
			return 29;
		}

		return arr_day[d._month];
	}

	// 运算符重载

	// d1 = d2 , return Date&类型
	Date& operator=(const Date& d);

	// d1+=day , return Date&类型
	Date& operator+=(int day);

	// d1+day, return Date类型
	Date operator+(int day);

	// d1-=day , return Date&类型
	Date& operator-=(int day);

	// d1-day, return Date类型
	Date operator-(int day);

	// d1 == d2 , return bool类型
	bool operator==(const Date& d);

	// d1 != d2 , return bool类型
	bool operator!=(const Date& d);

	// 前置++ 后置++

	// ++d1 -> d1.operator++(&d);
	Date& operator++();

	// d1++ -> d1.operator++(&d, 0);
	Date operator++(int);

	// 比较大小
	
	// >
	bool operator>(const Date& d);

	// <
	bool operator<(const Date& d);

	// >=
	bool operator>=(const Date& d);

	// <=
	bool operator<=(const Date& d);

	// 日期-日期 , return int -> 天数
	int operator-(const Date& d);

private:
	// 年/月/日
	int _year;
	int _month;
	int _day;
};

Date.cpp

#include "Date.h"

// 日期类默认构造函数
Date::Date(int year, int month, int day) // 这边缺省参数声明和定义只需要在声明时显示写出即可
{
	cout << "日期类默认构造函数" << endl;
	_year = year;
	_month = month;
	_day = day;
}

// 打印日期
void Date::Print()
{
	cout << _year << "/" << _month << "/" << _day << endl;
}

// 日期类拷贝构造函数
Date::Date(const Date& d)
{
	cout << "日期类拷贝构造函数" << endl;
	_year = d._year;
	_month = d._month;
	_day = d._day;
}

// 运算符重载

// d1 = d2 , return Date类型
Date& Date::operator=(const Date& d)
{
	cout << "Date& Date::operator=(const Date& d)" << endl;
	_year = d._year;
	_month = d._month;
	_day = d._day;

	return *this;
}

// d1+=day , return Date&类型
Date& Date::operator+=(int day)
{
	if (day < 0)
	{
		return *this -= (-day);
	}
	_day += day;
	while (_day > GetMonthDay(*this))
	{
		_day -= GetMonthDay(*this);
		++_month;
		if (_month == 13)
		{
			++_year;
			_month = 1;
		}
	}

	return *this;
}

// d1+day, return Date类型
Date Date::operator+(int day)
{
	Date tmp = *this;
	tmp += day;

	return tmp;
}

// d1-=day , return Date&类型
Date& Date::operator-=(int day)
{
	if (day < 0)
	{
		return *this += (-day);
	}
	_day -= day;
	while (_day <= 0)
	{
		--_month;
		if (_month == 0)
		{
			--_year;
			_month = 12;
		}
		_day += GetMonthDay(*this);
	}

	return *this;
}

// d1-day, return Date类型
Date Date::operator-(int day)
{
	Date tmp = *this;
	tmp -= day;

	return tmp;
}

// 前置++ 后置++

// ++d1 -> d1.operator++(&d);
Date& Date::operator++()
{
	*this += 1;
	return *this;
}

// d1++ -> d1.operator++(&d, 0);
Date Date::operator++(int)
{
	Date ret(*this);

	*this += 1;

	return ret;
}

// d1 == d2 , return bool类型
bool Date::operator==(const Date& d)
{
	return _year == d._year && _month == d._month && _day == d._day;
}

// d1 != d2 , return bool类型
bool Date::operator!=(const Date& d)
{
	return !(*this == d);
}

// 比较大小

// >
bool Date::operator>(const Date& d)
{
	if (_year > d._year)
	{
		return true;
	}
	else if (_year == d._year)
	{
		if (_month > d._month)
		{
			return true;
		}
		else if (_month == d._month)
		{
			if (_day > d._day)
			{
				return true;
			}
			else {
				return false;
			}
		}
		else {
			return false;
		}
	}
	else {
		return false;
	}
}

// <
bool Date::operator<(const Date& d)
{
	return !(*this >= d);
}

// >=
bool Date::operator>=(const Date& d)
{
	return *this > d || *this == d;
}

// <=
bool Date::operator<=(const Date& d)
{
	return !(*this > d);
}

// 日期-日期 , return int -> 天数
int Date::operator-(const Date& d)
{
	int flag = 1;
	Date max = *this;
	Date min = d;
	// 假设法
	if (*this < d)
	{
		min = *this;
		max = d;
		flag = -1;
	}
	int day = 0;
	while (min < max)
	{
		++min;
		++day;
	}

	return day * flag;

}

Text.cpp 

#include "Date.h"

void Text01()
{
	// 测试默认构造
	//Date d1;
	//d1.Print();

	//Date d2(2024, 7, 21);
	//d2.Print();

	// 测试拷贝构造函数
	//Date d1(2024, 7, 21);
	//d1.Print();

	//Date d2(d1);
	//d2.Print();

	//Date d2 = d1;
	//d2.Print();

	// 测试运算符重载(=)
	//Date d1(2024, 7, 21);
	//Date d2, d3;
	//d2 = d3 = d1;
	//d1.Print();
	//d2.Print();
	//d3.Print();

	// 测试运算符重载(+=)
	//Date d1(2024, 7, 21);
	//d1 += 50000;
	//d1.Print();

	// 测试运算符重载(+)
	//Date d1(2024, 7, 21);
	//Date d2(d1 + 50000);
	//d1.Print();
	//d2.Print();

	// 测试运算符重载(-=)
	//Date d1(2024, 7, 21);
	//d1 -= 50000;
	//d1.Print();

	// 测试运算符重载(-)
	//Date d1(2024, 7, 21);
	//Date d2(d1 - 50000);
	//d1.Print();
	//d2.Print();

	// 测试运算符重载(前置++)
	/*Date d1(2024, 7, 31);
	Date d2(++d1);
	d1.Print();
	d2.Print();*/
	
	// 测试运算符重载(后置++)
	//Date d1(2024, 7, 31);
	//Date d2(d1++);
	//d1.Print();
	//d2.Print();

	// 测试运算符重载(==)
	//Date d1(2024, 7, 31);
	//Date d2(2024, 7, 31);
	//bool ret = (d1 == d2);
	//cout << ret << endl;

	// 测试运算符重载(!=)
	//Date d1(2024, 7, 31);
	//Date d2(2024, 7, 21);
	//bool ret = (d1 != d2);
	//cout << ret << endl;

	// 测试运算符重载(>)
	//Date d1(2024, 7, 31);
	//Date d2(2024, 7, 21);
	//bool ret = (d1 > d2);
	//cout << ret << endl;

	// 测试运算符重载(>=)
	//Date d1(2024, 7, 31);
	//Date d2(2024, 7, 31);
	//bool ret = (d1 >= d2);
	//cout << ret << endl;

	// 测试运算符重载(<)
	//Date d1(2024, 7, 31);
	//Date d2(2024, 7, 31);
	//bool ret = (d1 < d2);
	//cout << ret << endl;

	// 测试运算符重载(<=)
	//Date d1(2024, 7, 31);
	//Date d2(2024, 7, 31);
	//bool ret = (d1 <= d2);
	//cout << ret << endl;

	// 测试运算符重载(日期-日期)
	//Date d1(1958, 7, 11);
	//Date d2(2024, 7, 21);
	//cout << d1 - d2 << endl;

}


int main()
{
	Text01();
	return 0;
}

 

 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1941008.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

abc363+cf960div.2+牛客周赛49轮

C - Avoid K Palindrome 2 (atcoder.jp) 思路&#xff1a; 罗列出排列的每一种情况&#xff0c;再根据题目要求进行判断 代码&#xff1a; void solve() {ll n, k;cin >> n >> k;string s;vector<char>a;cin >> s;for (int i 0; i < n; i)a.pus…

在Windows安装、部署Tomcat的方法

本文介绍在Windows操作系统中&#xff0c;下载、配置Tomcat的方法。 Tomcat是一个开源的Servlet容器&#xff0c;由Apache软件基金会的Jakarta项目开发和维护&#xff1b;其提供了执行Servlet和Java Server Pages&#xff08;JSP&#xff09;所需的所有功能。其中&#xff0c;S…

hcip报名费用多少?该如何备考hcip?

现在很多行业都比较萧条&#xff0c;但是有个行业正是热门的时候&#xff0c;那就是网络领域&#xff0c;那么想进入这个领域&#xff0c;肯定知道hcip是什么&#xff0c;那么小编就针对几个常常被问到两个话题&#xff0c;hcip报名费用多少?该如何备考hcip?给大家好好聊聊其…

JavaScript进阶之深入面向对象

目录 深入面向对象一、编程思想1.1 面向过程1.2 面向对象&#xff08;oop&#xff09; 二、构造函数三、原型3.1 原型3.2 constructor属性3.3 对象原型3.4 原型继承3.5 原型链 深入面向对象 一、编程思想 1.1 面向过程 面向过程是分析解决问题所需要的步骤&#xff0c;用函数…

Python爬虫实战 | 爬取携程网景区评论|美食推荐|景点列表数据

本文采用Selenium库爬取携程网的景区评论。 携程接口接入 Selenium介绍 Selenium是一个Web的自动化测试工具&#xff0c;可以按指定的命令自动操作&#xff0c;如让浏览器加载页面、获取数据、页面截屏等。Selenium本身不自带浏览器&#xff0c;需要与第三方浏览器结合才能使…

Mysql高价语句

一.高级语法的查询语句 1.排序语法&#xff08;默认的排序方式就是升序&#xff09;。 升序ASC&#xff1a;select * from test01 order by name; 降序DESC&#xff1a;select * from test01 order by name desc; 多个列排序&#xff1a;以多个列作为排序&#xff0c;只有第一…

分布式服务框架zookeeper+消息队列kafka

一、zookeeper概述 zookeeper是一个分布式服务框架&#xff0c;它主要是用来解决分布式应用中经常遇到的一些数据管理问题&#xff0c;如&#xff1a;命名服务&#xff0c;状态同步&#xff0c;配置中心&#xff0c;集群管理等。 在分布式环境下&#xff0c;经常需要对应用/服…

【Python】爬虫实战02:电影市场票房情况分析与可视化

1. 前言 在信息爆炸的时代&#xff0c;数据分析已成为各行各业的重要工具。特别是在电影行业&#xff0c;票房数据不仅反映了电影的市场表现&#xff0c;也是电影产业健康发展的关键指标。为了更好地理解和分析中国大陆电影市场的票房情况&#xff0c;本代码提供了一个自动化数…

【Linux/Windows】Wireshark抓包工具下载、安装、使用、数据分析、常用知识点

文章目录 Linux版下载Windows版下载Wireshark使用Wireshark测试Tcp三次握手Wireshark常见过滤条件本篇小结 更多相关内容可查看 在一个阳光明媚的周五清晨&#xff0c;一起快乐的玩耍一下Wireshark Linux版下载 1.使用yum安装wireshark yum -y install wireshark2.使用yum安…

全网最简单的Mysql 8.3 安装及环境配置教程

Windows系统计算机环境配置 第一篇关于环境配置的文档之MySQL 8.3&#xff08;msi版本和zip版本略有不同&#xff0c;本文档介绍msi版本&#xff0c;若zip版本有需求&#xff0c;请在评论区留言&#xff0c;我后续会出相关文档。&#xff09; 前言 网上的MySQL配置教程非常多…

杰发科技AC7840——SENT数据解析及软件Sent发送的实现

0. 测试环境 AC7840官方Demo板&#xff1b; 图莫斯0503 DSlogic U2Basic 使用引脚 输出脚&#xff1a;PB1 时钟&#xff1a;PB2&#xff0c;其他引脚可以不初始化&#xff0c;不接线 1. 数据解析 以下是SENT数据的格式&#xff08;1tick以3us为例&#xff09;&#…

智能优化算法之灰狼优化算法(GWO)

智能优化算法是一类基于自然界中生物、物理或社会现象的优化技术。这些算法通过模拟自然界中的一些智能行为&#xff0c;如遗传学、蚁群觅食、粒子群体运动等&#xff0c;来解决复杂的优化问题。智能优化算法广泛应用于各种工程和科学领域&#xff0c;因其具有全局搜索能力、鲁…

Android Display Graphics #User APP的绘制与WMS

如果图片链接失败&#xff0c;请扫码查看文章详情。 Android Display Graphics系列文章-汇总 系列文章请扫关注公众号&#xff01; 1、User APP的绘制 用户APP在调用ViewRootImpl#setView()方法时&#xff0c;首次请求VSync信号。之后进入loop循环&#xff0c;等待显示事件。…

【数据结构】:链表实现洗牌功能

此操作包含的基本功能有&#xff1a; 组牌&#xff1a;组建 52 张扑克牌 四种花色&#xff1a;“♥️”&#xff0c;“♠️”&#xff0c;“⬛️”&#xff0c;“♣️”每种花色 13 张牌&#xff1a;1~13 洗牌&#xff1a;将 52 张扑克牌打乱顺序发牌&#xff1a;给三个人每人发…

关于光伏电站监控数据

电站监控后台显示的发电量数据不能真实的反应不同逆变器方案的发电量差异。组串式逆变器由于交流线缆长&#xff0c;损耗的电量比集中式方案高1-2%左右。在通过监控后台显示的发电量衡量不同逆变器的差异时&#xff0c;需要减掉这部分差值。 光伏电站监控后台统计的发电量是从光…

桌面小宠物发布一周,第一次以独立开发者的身份赚到了100块

收入数据(AppStore一周收入统计) AppStore付费工具榜第七 应用简介 桌面新宠(NewPet)&#xff0c;是我耗时半年开发的一款桌面宠物。我是被 QQ 宠物影响的那批人&#xff0c;上学时天天给 QQ 宠物喂食&#xff0c;很可惜它现在不在了。所以&#xff0c;我开发的初衷是想要在电…

图像分类算法概述:深度学习方法

图像分类算法概述&#xff1a;深度学习方法 图像分类是计算机视觉中的一个基本任务&#xff0c;近年来随着深度学习的发展&#xff0c;图像分类算法取得了巨大的进步。本文将概述主要的深度学习图像分类算法。 #mermaid-svg-fkTtkPLl9ahuVT6w {font-family:"trebuchet ms…

Linux(CentOS7)部署PHP-7.2.17源码包

PHP-7.2.17源码包部署 安装php1. 解压并进入php-7.2.17文件夹2. 编写php.sh脚本3. 执行php.sh 配置Apache与PHP1. 编写httpd.conf配置文件2. 编写php测试脚本 部署HTTPD-2.4.37源码包点击跳转 部署MySQL-5.6.31源码点击跳转 下载源码包和依赖的源码包&#xff0c;资源见文章顶…

TiDB实践—索引加速+分布式执行框架创建索引提升70+倍

作者&#xff1a; 数据源的TiDB学习之路 原文来源&#xff1a; https://tidb.net/blog/92d348c2 背景介绍 TiDB 采用在线异步变更的方式执行 DDL 语句&#xff0c;从而实现 DDL 语句的执行不会阻塞其他会话中的 DML 语句。按照是否需要操作 DDL 目标对象所包括的数据来划分…

linux学习week4+5

linux学习 十四.shell编程 9.单分支多分支 基本语法&#xff1a; if [ 条件 ] then代码 elif [ 条件 ] then代码 fi10.case语句 基本语法&#xff1a; case $变量名 in "值1") 程序1&#xff08;如果变量的值等于值1&#xff0c;则执行程序1&#xff09; ;; &q…