list类的详细讲解

news2025/5/12 21:04:53
【本节目标】
1. list的介绍及使用
2. list的深度剖析及模拟实现
3. list与vector的对比

1. list的介绍及使用

1.1 list的介绍

1. list 是可以在常数范围内在任意位置进行插入和删除的序列式容器,并且该容器可以前后双向迭代。
2. list 的底层是双向链表结构,双向链表中每个元素存储在互不相关的独立节点中,在节点中通过指针指向 其前一个元素和后一个元素。
3. list forward_list 非常相似:最主要的不同在于 forward_list 是单链表,只能朝前迭代,已让其更简单高 效。
4. 与其他的序列式容器相比 (array vector deque) list 通常在任意位置进行插入、移除元素的执行效率 更好。
5. 与其他序列式容器相比, list forward_list 最大的缺陷是不支持任意位置的随机访问,比如:要访问 list 的第6 个元素,必须从已知的位置 ( 比如头部或者尾部 ) 迭代到该位置,在这段位置上迭代需要线性的时间 开销;list 还需要一些额外的空间,以保存每个节点的相关联信息 ( 对于存储类型较小元素的大 list 来说这 可能是一个重要的因素)


1.2 list的使用

ist 中的接口比较多,此处类似,只需要掌握如何正确的使用,然后再去深入研究背后的原理,已达到可扩展 的能力。以下为list 中一些 常见的重要接口。


1.2.1 list的构造

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
using namespace std;
#include <list>
#include <vector>



// list的构造
void TestList1()
{
    list<int> l1;                         // 构造空的l1
    list<int> l2(4, 100);                 // l2中放4个值为100的元素
    list<int> l3(l2.begin(), l2.end());  // 用l2的[begin(), end())左闭右开的区间构造l3
    list<int> l4(l3);                    // 用l3拷贝构造l4

    // 以数组为迭代器区间构造l5
    int array[] = { 16,2,77,29 };
    list<int> l5(array, array + sizeof(array) / sizeof(int));

    // 列表格式初始化C++11
    list<int> l6{ 1,2,3,4,5 };

    // 用迭代器方式打印l5中的元素
    list<int>::iterator it = l5.begin();
    while (it != l5.end())
    {
        cout << *it << " ";
        ++it;
    }       
    cout << endl;

    // C++11范围for的方式遍历
    for (auto& e : l5)
        cout << e << " ";

    cout << endl;
}

1.2.2 list iterator的使用

此处,大家可暂时 将迭代器理解成一个指针,该指针指向 list 中的某个节点

【注意】
1. begin end 为正向迭代器,对迭代器执行 ++ 操作,迭代器向后移动
2. rbegin(end) rend(begin) 为反向迭代器,对迭代器执行 ++ 操作,迭代器向前移动


// list迭代器的使用
// 注意:遍历链表只能用迭代器和范围for
void PrintList(const list<int>& l)
{
    // 注意这里调用的是list的 begin() const,返回list的const_iterator对象
    for (list<int>::const_iterator it = l.begin(); it != l.end(); ++it)
    {
        cout << *it << " ";
        // *it = 10; 编译不通过
    }

    cout << endl;
}

void TestList2()
{
    int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
    list<int> l(array, array + sizeof(array) / sizeof(array[0]));
    // 使用正向迭代器正向list中的元素
    // list<int>::iterator it = l.begin();   // C++98中语法
    auto it = l.begin();                     // C++11之后推荐写法
    while (it != l.end())
    {
        cout << *it << " ";
        ++it;
    }
    cout << endl;

    // 使用反向迭代器逆向打印list中的元素
    // list<int>::reverse_iterator rit = l.rbegin();
    auto rit = l.rbegin();
    while (rit != l.rend())
    {
        cout << *rit << " ";
        ++rit;
    }
    cout << endl;
}

1.2.3 list capacity

1.2.4 list element access

1.2.5 list modifiers


// list插入和删除
// push_back/pop_back/push_front/pop_front
void TestList3()
{
    int array[] = { 1, 2, 3 };
    list<int> L(array, array + sizeof(array) / sizeof(array[0]));

    // 在list的尾部插入4,头部插入0
    L.push_back(4);
    L.push_front(0);
    PrintList(L);

    // 删除list尾部节点和头部节点
    L.pop_back();
    L.pop_front();
    PrintList(L);
}

// insert /erase 
void TestList4()
{
    int array1[] = { 1, 2, 3 };
    list<int> L(array1, array1 + sizeof(array1) / sizeof(array1[0]));

    // 获取链表中第二个节点
    auto pos = ++L.begin();
    cout << *pos << endl;

    // 在pos前插入值为4的元素
    L.insert(pos, 4);
    PrintList(L);

    // 在pos前插入5个值为5的元素
    L.insert(pos, 5, 5);
    PrintList(L);

    // 在pos前插入[v.begin(), v.end)区间中的元素
    vector<int> v{ 7, 8, 9 };
    L.insert(pos, v.begin(), v.end());
    PrintList(L);

    // 删除pos位置上的元素
    L.erase(pos);
    PrintList(L);

    // 删除list中[begin, end)区间中的元素,即删除list中的所有元素
    L.erase(L.begin(), L.end());
    PrintList(L);
}
// resize/swap/clear
void TestList5()
{
    // 用数组来构造list
    int array1[] = { 1, 2, 3 };
    list<int> l1(array1, array1 + sizeof(array1) / sizeof(array1[0]));
    PrintList(l1);

    // 交换l1和l2中的元素
    list<int> l2;
    l1.swap(l2);
    PrintList(l1);
    PrintList(l2);

    // 将l2中的元素清空
    l2.clear();
    cout << l2.size() << endl;
}
list 中还有一些操作,需要用到时大家可参阅 list 的文档说明。

1.2.6 list的迭代器失效

前面说过,此处大家可将迭代器暂时理解成类似于指针, 迭代器失效即迭代器所指向的节点的无效,即该节 点被删除了 。因为 list 的底层结构为带头结点的双向循环链表 ,因此 list 中进行插入时是不会导致 list 的迭代 器失效的,只有在删除时才会失效,并且失效的只是指向被删除节点的迭代器,其他迭代器不会受到影响

void TestListIterator1()
{
	int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
	list<int> l(array, array + sizeof(array) / sizeof(array[0]));
	auto it = l.begin();
	while (it != l.end())
	{
		// erase()函数执行后,it所指向的节点已被删除,因此it无效,在下一次使用it时,必须先给其赋值
			l.erase(it);
		++it;
	}
}
// 改正
void TestListIterator()
{
	int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
	list<int> l(array, array + sizeof(array) / sizeof(array[0]));
	auto it = l.begin();
	while (it != l.end())
	{
		l.erase(it++); // it = l.erase(it);
	}
}

2. list的模拟实现

2.1 模拟实现list

要模拟实现 list ,必须要熟悉 list 的底层结构以及其接口的含义,通过上面的学习,这些内容已基本掌握,现 在我们来模拟实现list
#pragma once
#include <assert.h>
#include <iostream>

namespace xyl
{
	template<class T>

	//list节点类
	struct ListNode
	{
		ListNode(const T& val = T())
			:_pPrev(nullptr)
			, _pNext(nullptr)
			,_val(val)
		{

		}

		ListNode<T>* _pPrev;
		ListNode<T>* _pNext;
		T _val;
	};

	//List迭代器类
	template<class T,class Ref,class Ptr>
	struct ListIterator
	{
		typedef ListNode<T>* PNode;
		typedef ListIterator<T, Ref, Ptr> Self;
		ListIterator(PNode pNode = nullptr)
			:_pNode(pNode)
		{
		}

		ListIterator(const Self & l)
			:_pNode(l._pNode)
		{

		}

		T& operator*()
		{
			return _pNode->_val;
		}

		T* operator->()
		{
			return &(_pNode->_val);
		}

		Self& operator++()
		{
			_pNode = _pNode->_pNext;
			return *this;
		}

		Self operator++(int)
		{
			Self tmp(*this);
			_pNode = _pNode->_pNext;
			return tmp;
		}

		Self& operator--()
		{
			_pNode = _pNode->_pPrev;
			return *this;
		}

		Self& operator--(int)
		{
			Self tmp(*this);
			_pNode = _pNode->_pPrev;
				return tmp;
		}

		bool operator==(const Self& l)
		{
			return _pNode == l._pNode;
		}

		bool operator!=(const Self& l)
		{
			return _pNode != l._pNode;
		}

		PNode _pNode;
	};

	//list类
	template< class T >
	class list
	{
		typedef ListNode<T> Node;
		typedef Node* PNode;

		public:
			typedef ListIterator<T, T&,  T*> iterator;
			typedef ListIterator<T,const T&, const T*> const_iterator;

	public:
		void init_empty()
		{
			_head = new Node;

			_head->_pPrev = _head;

			_head->_pNext = _head;
			size = 0;
		}

		list()
		{
			init_empty();
		}

		list(int n, const T& val = T())
		{
			init_empty();

			for (int i = 0;i < n;i++)
			{
				push_back(val);
				
			}
		}

		template <class Iterator>

		list(Iterator first, Iterator last)
		{
			init_empty();

			while (first != last)
			{
				push_back(*first);
				first++;
			}
		}

		list(const list<T>& l)
		{
			init_empty();

			const_iterator it = l.begin();
			while (it != l.end())
			{
				push_back(*it);
				it++;
			}
		}

		~list()
		{
			clean();
			delete _head;
			_head = nullptr;
		}

		void clean()
		{
			iterator it = begin();
			while (it != end())
			{
				it=erase(it);
			}

			_head->_pNext = _head;
			_head->_pPrev = _head;
		}

		list<T>& operator=(const list<T>& l)
		{
			list<T> tmp(l);

			swap(tmp);

			return *this;
		}

		size_t _size()
		{
			return size;
		}

		bool empty()
		{
			return size == 0;
		}

		T& front()
		{
			return _head->_pNext->_val;
		}

		T& back()
		{
			return _head->_pPrev->_val;
		}

		const T& front() const
		{
			return _head->_pNext->_val;
		}

		const T& back() const
		{
			return _head->_pPrev->_val;
		}

		void push_back(const T& val)
		{
			
			/*PNode cur= new Node(val);
			PNode tail = _head->_pPrev;

			cur->_pPrev = tail;
			cur->_pNext = _head;

			tail->_pNext = cur;
			_head->_pPrev = cur;
			size++;*/
			
			insert(end(), val);
		}

		void push_front(const T& val)
		{
			insert(begin(), val);
		}

		void pop_back()
		{
			erase(--end());
		}

		void pop_front()
		{
			erase(begin());
		}

		iterator insert(iterator pos, const T& val)
		{

			PNode newnode = new Node(val);
			PNode cur = pos._pNode;

			PNode prev = cur->_pPrev;

			prev->_pNext = newnode;
			newnode->_pPrev = prev;

			newnode->_pNext = cur;
			cur->_pPrev = newnode;

			size++;

			return iterator(newnode);
		}

		iterator erase(iterator pos)
		{
			//找到删除节点
			PNode del = pos._pNode;
			//存储删除节点的下一位当返回值
			PNode tmp = del->_pNext;

			PNode next = del->_pNext;
			PNode prev = del->_pPrev;

			prev->_pNext = next;
			next->_pPrev = prev;

			delete del;
			size--;
			return iterator(tmp);
		}

		iterator begin() 
		{
			return (_head->_pNext);
		}

		iterator end() 
		{
			return (_head);
		}


		const_iterator begin() const
		{
			return (_head->_pNext);
		}

		const_iterator end() const
		{
			return (_head);
		}

		void swap(list<T>& l)
		{
			std::swap(_head, l._head);
			std::swap(size, l.size);
		}
	
		PNode _head;
		size_t size;
	};
}

#include <iostream>

#include "list.h"

using namespace std;

void test_list1()
{
	xyl::list<int> list1;
	list1.push_back(1);
	list1.push_back(2);
	list1.push_back(3);
	list1.push_back(4);

	xyl::list<int>:: iterator it1 = list1.begin();
	while (it1 != list1.end())
	{
		cout << (*it1) << ' ';
		++it1;
	}
	
	cout << endl;

	cout << list1.size;

	cout << endl;

	xyl::list<int> list2(10,1);

	xyl::list<int>::iterator it2 = list2.begin();
	while (it2 != list2.end())
	{
		cout << (*it2) << ' ';
		++it2;
	}

	cout << endl;


}

void test_list2()
{
	xyl::list<int> list1;
	list1.push_back(1);
	list1.push_back(2);
	list1.push_back(3);
	list1.push_back(4);

	xyl::list<int>::iterator it1 = list1.begin();
	while (it1 != list1.end())
	{
		cout << (*it1) << ' ';
		++it1;
	}

	cout << endl;

	xyl::list<int> list2(++list1.begin(),list1.end());

	xyl::list<int>::iterator it2 = list2.begin();

	while (it2 != list2.end())
	{
		cout << (*it2) << ' ';
		++it2;
	}

	cout << endl;

	xyl::list<int> list3(list2);

	xyl::list<int>::iterator it3 = list3.begin();

	while (it3 != list3.end())
	{
		cout << (*it3) << ' ';
		++it3;
	}

	cout << endl;
}

void test_list3()
{
	xyl::list<int> list1;
	list1.push_back(1);
	list1.push_back(2);
	list1.push_back(3);
	list1.push_back(4);

	xyl::list<int>::iterator it1 = list1.begin();
	while (it1 != list1.end())
	{
		cout << (*it1) << ' ';
		++it1;
	}

	cout << endl;

	xyl::list<int> list2;

	list2 = list1;

	xyl::list<int>::iterator it2 = list2.begin();
	while (it2 != list2.end())
	{
		cout << (*it2) << ' ';
		++it2;
	}

	cout << endl;

	cout << list2.front() << endl;
	cout << list2.back() << endl;
}

void test_list4()
{
	xyl::list<int> list1;
	list1.push_back(1);
	list1.push_back(2);
	list1.push_back(3);
	list1.push_back(4);

	list1.erase(list1.begin());
	xyl::list<int>::iterator it1 = list1.begin();
	while (it1 != list1.end())
	{
		cout << (*it1) << ' ';
		++it1;
	}

	list1.clean();

	while (it1 != list1.end())
	{
		cout << (*it1) << ' ';
		++it1;
	}

}

void test_list5()
{
	xyl::list<int> list1;
	list1.push_back(1);
	list1.push_back(2);
	list1.push_back(3);
	list1.push_back(4);

	

	list1.insert(list1.begin(), 3);

	xyl::list<int>::iterator it1 = list1.begin();

	while (it1 != list1.end())
	{
		cout << (*it1) << ' ';
		++it1;
	}
	cout << endl;

	list1.pop_back();

	 it1 = list1.begin();

	while (it1 != list1.end())
	{
		cout << (*it1) << ' ';
		++it1;
	}

	cout << endl;

	list1.pop_front();

	it1 = list1.begin();

	while (it1 != list1.end())
	{
		cout << (*it1) << ' ';
		++it1;
	}
	cout << endl;

	list1.push_front(5);

	 it1 = list1.begin();

	while (it1 != list1.end())
	{
		cout << (*it1) << ' ';
		++it1;
	}
	cout << endl;
}

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

2.2 list的反向迭代器

通过前面例子知道,反向迭代器的 ++ 就是正向迭代器的 -- ,反向迭代器的 -- 就是正向迭代器的 ++ ,因此反向迭 代器的实现可以借助正向迭代器,即:反向迭代器内部可以包含一个正向迭代器,对正向迭代器的接口进行 包装即可。

template<class Iterator>
class ReverseListIterator
{
	// 注意:此处typename的作用是明确告诉编译器,Ref是Iterator类中的类型,而不是静态成员变量
	// 否则编译器编译时就不知道Ref是Iterator中的类型还是静态成员变量
	// 因为静态成员变量也是按照 类名::静态成员变量名 的方式访问的
public:
	typedef typename Iterator::Ref Ref;
	typedef typename Iterator::Ptr Ptr;
	typedef ReverseListIterator<Iterator> Self;
public:
	//
	// 构造
	ReverseListIterator(Iterator it) : _it(it) {}
	//
	// 具有指针类似行为
	Ref operator*() {
		Iterator temp(_it);
		--temp;
		return *temp;
	}
	Ptr operator->() { return &(operator*()); }
	//
	// 迭代器支持移动
	Self& operator++() {

		--_it;
		return *this;
	}
	Self operator++(int) {
		Self temp(*this);
		--_it;
		return temp;
	}
	Self& operator--() {
		++_it;
		return *this;
	}
	Self operator--(int)
	{
		Self temp(*this);
		++_it;
		return temp;
	}
	//
	// 迭代器支持比较
	bool operator!=(const Self& l)const { return _it != l._it; }
	bool operator==(const Self& l)const { return _it != l._it; }
	Iterator _it;
};

3. listvector的对比

vector list 都是 STL 中非常重要的序列式容器,由于两个容器的底层结构不同,导致其特性以及应用场景不 同,其主要不同如下:

 

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

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

相关文章

Linux系统下安装mongodb

1. 配置MongoDB的yum仓库 创建仓库文件 sudo vi /etc/yum.repos.d/mongodb-org.repo添加仓库配置 根据系统版本选择配置&#xff08;以下示例为CentOS 7和CentOS 9的配置&#xff09;&#xff1a; CentOS 7&#xff08;安装MongoDB 5.0/4.2等旧版本&#xff09;&#xff1a; In…

kuka, fanuc, abb机器人和移动相机的标定

基础知识 : 一, 9点标定之固定相机标定: 图1: 固定位置相机拍照 因为相机和机器人的基坐标系是固定的, 所以在海康威视相机的9点标定功能栏中, 填上海康使用“圆查找”捕捉到的坐标值, 再将机器人显示的工具坐标系在基坐标系的实时位置pos_act值填入物理坐标X, Y中即可 图2:…

Android Framework学习四:init进程实现

文章目录 init流程简介init源码执行顺序执行顺序 init进程的具体工作事项挂载文件系统设置 SELinuxSecondStageMaininit.rc启动zygote和serviceManager进程的重要性serviceManager工作原理 Framework学习之系列文章 init流程简介 下面图片主要围绕 Android 系统中init进程的运…

Java引用RabbitMQ快速入门

这里写目录 Java发送消息给MQ消费者接收消息实现一个队列绑定多个消费者消息推送限制 Fanout交换机路由的作用Direct交换机使用案例 Topic交换机声明队列和交换机的方式MQ消息转换器业务改造生产者可靠性设置重连 系统可靠性 Java发送消息给MQ public void testSendMessage() t…

用R语言+随机森林玩转遥感空间预测-基于R语言机器学习遥感数据处理与模型空间预测技术及实际项目案例分析

遥感数据具有高维度、非线性及空间异质性等特点&#xff0c;传统分析方法往往难以充分挖掘其信息价值。机器学习技术的引入为遥感数据处理与模型预测提供了新的解决方案&#xff0c;其中随机森林&#xff08;Random Forest&#xff09;以其优异的性能和灵活性成为研究者的首选工…

Spring Boot 文件上传实现详解

在项目开发过程中&#xff0c;文件上传是极为常见的功能需求。对于熟悉 Spring MVC 文件上传操作的开发者而言&#xff0c;Spring Boot 中的文件上传与之原理基本相通&#xff0c;只是在依赖管理和配置方式上更为简化。接下来&#xff0c;将详细阐述 Spring Boot 项目中文件上传…

查看单元测试覆盖率

文章目录 1、POM文件配置2、编写单元测试3、执行单元测试4、查看单元测试覆盖率 1、POM文件配置 pom文件配置jacoco插件 <!-- 生成JaCoCo覆盖率数据插件 --> <plugin><groupId>org.jacoco</groupId><artifactId>jacoco-maven-plugin</artif…

基于SpringBoot的在线教育管理系统

作者&#xff1a;计算机学姐 开发技术&#xff1a;SpringBoot、SSM、Vue、MySQL、JSP、ElementUI、Python、小程序等&#xff0c;“文末源码”。 专栏推荐&#xff1a;前后端分离项目源码、SpringBoot项目源码、Vue项目源码、SSM项目源码、微信小程序源码 精品专栏&#xff1a;…

C# 方法(方法重载)

本章内容: 方法的结构 方法体内部的代码执行 局部变量 局部常量 控制流 方法调用 返回值 返回语句和void方法 局部函数 参数 值参数 引用参数 引用类型作为值参数和引用参数 输出参数 参数数组 参数类型总结 方法重载 命名参数 可选参数 栈帧 递归 方法重载 一个类中可以有多个…

3、食品包装控制系统 - /自动化与控制组件/food-packaging-control

76个工业组件库示例汇总 食品包装线控制系统 这是一个用于食品包装线控制系统的自定义组件&#xff0c;提供了食品包装生产线的可视化监控与控制界面。组件采用工业风格设计&#xff0c;包含生产流程控制、实时数据监控和逻辑编程三个主要功能区域。 功能特点 工业风格UI设…

初始图形学(7)

上一章完成了相机类的实现&#xff0c;对之前所学的内容进行了封装与整理&#xff0c;现在要学习新的内容。 抗锯齿 我们放大之前渲染的图片&#xff0c;往往会发现我们渲染的图像边缘有尖锐的"阶梯"性质。这种阶梯状被称为"锯齿"。当真实的相机拍照时&a…

线程的一些事(2)

在java中&#xff0c;线程的终止&#xff0c;是一种“软性”操作&#xff0c;必须要对应的线程配合&#xff0c;才能把终止落实下去 然而&#xff0c;系统原生的api其实还提供了&#xff0c;强制终止线程的操作&#xff0c;无论线程执行到哪&#xff0c;都能强行把这个线程干掉…

使用lldb看看Rust的HashMap

目录 前言 正文 读取桶的状态 获取键值对 键值对的指针地址 此时&#xff0c;读取数据 读取索引4的键值对 多添加几个键值对 使用i32作为键&#xff0c;&str作为值 使用i32作为键&#xff0c;String作为值 前言 前面使用ldb看了看不同的类型&#xff0c;这篇再使用…

2025最新免费视频号下载工具!支持Win/Mac,一键解析原画质+封面

软件介绍 适用于Windows 2025 最新5月蝴蝶视频号下载工具&#xff0c;免费使用&#xff0c;无广告且免费&#xff0c;支持对原视频和封面进行解析下载&#xff0c;亲测可用&#xff0c;现在很多工具都失效了&#xff0c;难得的几款下载视频号工具&#xff0c;大家且用且珍…

Newton GPU 机器人仿真器入门教程(零)— NVIDIA、DeepMind、Disney 联合推出

系列文章目录 目录 系列文章目录 前言 一、快速入门 1.1 实时渲染 1.2 USD 渲染 1.3 示例&#xff1a;创建一个粒子链 二、重要概念 三、API 参考 3.1 求解器 3.1.1 XPBD 求解器 3.1.2 VBD 求解器 3.1.3 MuJoCo 求解器 3.2 关节控制模式 四、Newton 集成 4.1 Is…

【C++】学习、项目时Debug总结

这里写目录标题 1. 内存问题1.1. 内存泄漏1.1.1. 内存泄漏案例检查方法1.1.2. 主线程提前退出导致【控】1.1.3. PostThreadMessage失败导致的内存泄漏**【控】**1.1.4. SendMessage 时关闭客户端【控】1.1.5. 线程机制导致【**控】**1.1.6. exit&#xff08;0&#xff09;导致【…

26考研——中央处理器_指令流水线_指令流水线的基本概念 流水线的基本实现(5)

408答疑 文章目录 六、指令流水线指令流水线的基本概念流水线的基本实现流水线设计的原则流水线的逻辑结构流水线的时空图表示 八、参考资料鲍鱼科技课件26王道考研书 六、指令流水线 前面介绍的指令都是在单周期处理机中采用串行方法执行的&#xff0c;同一时刻 CPU 中只有一…

AI Agent-基础认知与架构解析

定义 AI Agent 可以理解为一种具备感知、决策和行动能力的智能实体&#xff0c;能够在复杂的环境中自主运行&#xff0c;并根据环境变化动态调整自身行为&#xff0c;以实现特定目标。与传统的人工智能程序相比&#xff0c;AI Agent 具有更强的自主性、交互性和适应性。它不仅能…

C语言--字符函数

C语言--字符函数 一、字符函数1.1 iscntrl1.2 isspace1.3 isdigit1.4 isxdigit1.5 islower1.6 isupper1.7 isalpha1.8 isalnum1.9 ispunct1.10 isgraph1.11 isprint 在编程的过程中&#xff0c;我们会经常处理字符&#xff0c;为了方便操作&#xff0c;C语言标准库中提供了一系…

菜鸟之路Day30一一MySQL之DMLDQL

菜鸟之路Day30一一MySQL之DML&DQL 作者&#xff1a;blue 时间&#xff1a;2025.5.8 文章目录 菜鸟之路Day30一一MySQL之DML&DQL一.DML0.概述1.插入语句&#xff08;insert&#xff09;2.更新语句&#xff08;update&#xff09;3.删除语句&#xff08;delete&#xf…