" />

最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

C++順序容器(vector、deque、list)的使用詳解

 更新時(shí)間:2022年06月16日 10:13:34   作者:想吃讀研的  
本文主要介紹了C++順序容器(vector、deque、list)的使用詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧

一:STL(Standard Template Library),即標(biāo)準(zhǔn)模板庫(kù),是一個(gè)高效的C++程序庫(kù)

1.從實(shí)現(xiàn)層次看,整個(gè)STL是以一種類型參數(shù)化(type parameterized)的方式實(shí)現(xiàn)的,基于模板(template)。
2.從邏輯層次來(lái)看,在STL中體現(xiàn)了泛型化程序設(shè)計(jì)的思想(generic programming),在這種思想里,大部分基本算法被抽象,被泛化,獨(dú)立于與之對(duì)應(yīng)的數(shù)據(jù)結(jié)構(gòu),用于以相同或相近的方式處理各種不同情形。

二:STL組件

1.Container(容器) 各種基本數(shù)據(jù)結(jié)構(gòu)

2.Algorithm(算法) 各種基本算法如 sort search等

3.Iterator(迭代器) 連接containers 和 algorithms

4.了解:

  • Adapter(適配器) 可改變containers或function object接口的一種組件 
  • Function object(函數(shù)對(duì)象) *
  • Allocator(分配器)*

三:容器

1.容器類是容納、包含一組元素或元素集合的對(duì)象

2.七種基本容器:

向量(vector)、雙端隊(duì)列(deque)、鏈表(list)、集合(set)、多重集合(multiset)、映射(map)和多重映射(multimap)

四:類型成員

1.循環(huán)子操作:

  • begin():指向第一個(gè)元素
  • end():指向最后一個(gè)元素的后一個(gè)位置
  • rbegin():指向逆序的第一個(gè)元素
  • rend():指向逆序的最后一個(gè)元素的后一個(gè)位置

2.訪問(wèn)元素操作

  • front():訪問(wèn)第一個(gè)元素
  • back():訪問(wèn)最后一個(gè)元素
  • [ ]:無(wú)測(cè)試的下標(biāo)訪問(wèn)(不用于 list)
  • at():有測(cè)試的下標(biāo)訪問(wèn)(只用于 vector 和 deque)

3.堆棧和隊(duì)列操作

  • push_back():將新元素加入到尾部
  • pop_back():移出最后一個(gè)元素
  • push_front():將新元素加入頭部(只用于 list 和 deque)
  • pop_front():移出第一個(gè)元素(只用于 list 和 deque)

4.表操作

  • insert(p,x):將元素x加入到 p 之前
  • erase(p):刪除p處的元素
  • clear():清除所有的元素

五:迭代器

迭代器是面向?qū)ο蟀姹镜闹羔?,它們提供了訪問(wèn)容器、序列中每個(gè)元素的方法

六:順序容器

順序容器的接口

1.插入方法:push_front(),push_back(),insert(),運(yùn)算符“=”

2.刪除方法:pop() ,erase(),clear()

3.迭代訪問(wèn)方法:使用迭代器

4.其他順序容器訪問(wèn)方法(不修改訪問(wèn)方法):front(),back(),下標(biāo)[ ]運(yùn)算符

七:順序容器--向量(vector)

a.向量屬于順序容器,用于容納不定長(zhǎng)線性序列(即線性群體),提供對(duì)序列的快速隨機(jī)訪問(wèn)(也稱直接訪問(wèn))

b.數(shù)據(jù)結(jié)構(gòu)很像一個(gè)數(shù)組,所以與其他容器相比,vector 能非常方便和高效訪問(wèn)單個(gè)元素,支持隨機(jī)訪問(wèn)迭代子

c.向量是動(dòng)態(tài)結(jié)構(gòu),它的大小不固定,可以在程序運(yùn)行時(shí)增加或減少

d.與數(shù)組不同,向量的內(nèi)存用盡時(shí),向量自動(dòng)分配更大的連續(xù)內(nèi)存區(qū),將原先的元素復(fù)制到新的內(nèi)存區(qū),并釋放舊的內(nèi)存區(qū)。這是向量類的優(yōu)點(diǎn)。

頭文件:#include <vector>

例子:

1.push_back尾部添加

#include<iostream>
using namespace std;
#include<vector>
 
void demo_vector();
 
int main()
{
    demo_vector();
    return 0;
}
 
void demo_vector()
{
    vector<int> v;
 
    //迭代器
    vector<int>::iterator it;
    it = v.begin(); //開(kāi)始位置
   
    //在尾部添加
    v.push_back(1);
    v.push_back(12);
    //迭代器指針 遍歷向量容器
    for(it = v.begin();it<v.end();it++)
    {
        cout<<" "<<*it;  //取值
    } 
    // 1 12
    cout<<endl;
}

2.insert按照位置插入

#include<iostream>
using namespace std;
#include<vector>
 
void demo_vector();
 
int main()
{
    demo_vector();
    return 0;
}
 
void demo_vector()
{
    vector<int> v;
    //迭代器
    vector<int>::iterator it;
    it = v.begin(); //開(kāi)始位置
   
    //在尾部添加
    v.push_back(1);
    v.push_back(12);
    //按照位置插入
    v.insert(v.begin(),100);
 
    for(it = v.begin();it<v.end();it++)
    {
        cout<<" "<<*it;  //取值
    } 
    //  100 1 12
    cout<<endl;
}

3.獲取id(成員屬性)

CStaff.h

#ifndef CSTAFF_H
#define CSTAFF_H
#define ADMIN 1
#define MANAGER 2
#define WAITER 3
#include<string>
#include<iostream>
using namespace std;
 
class Staff
{
public:
    Staff();
    Staff(int id,string name,string pwd,int prole);
    ~Staff();
    int getId();
    string getName();
    string getPwd();
    int getRole();
private:
    int ID;
    string name;
    string pwd;
    int role;
};
 
#endif

CStaff.cpp

#include"CStaff.h"
#include<iostream>
using namespace std;
 
Staff::Staff()
{
}
 
Staff::Staff(int id,string name,string pwd,int prole)
{
    this->ID = id;
    this->name = name;
    this->pwd = pwd;
    this->role = prole;
}
 
int Staff::getId()
{
    return this->ID;
}
 
string Staff::getName()
{
    return this->name;
}
 
string Staff::getPwd()
{
    return this->pwd;
}
 
int Staff::getRole()
{
    return this->role;
}
 
Staff::~Staff()
{
}

main.cpp

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
void demo_vector();
 
int main()
{
    demo_vector();
    return 0;    
}
 
void demo_vector()
{
    vector<Staff *> staffV;
    vector<Staff *>::iterator it;
 
    staffV.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffV.push_back(new Staff(1002,"lily","1234",ADMIN));
    staffV.insert(staffV.begin(),new Staff(1003,"sam","1234",MANAGER));
 
    for(it=staffV.begin();it<staffV.end();it++)
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }
//    id:1003
//  id:1001
//  id:1002
}

4.按照位置插入insert --- 需要迭代器指針it++偏移

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
void demo_vector();
 
int main()
{
    demo_vector();
    return 0;    
}
 
void demo_vector()
{
    vector<Staff *> staffV;
    vector<Staff *>::iterator it;
 
    staffV.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffV.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    it = staffV.begin();  //開(kāi)始位置
    it++;
    staffV.insert(it,new Staff(1003,"sam","1234",MANAGER));
 
    for(it=staffV.begin();it<staffV.end();it++)
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }
//id:1001
//id:1003
//id:1002
}

5.尾部刪除pop_back

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
void demo_vector();
 
int main()
{
    demo_vector();
    return 0;    
}
 
void demo_vector()
{
    vector<Staff *> staffV;
    vector<Staff *>::iterator it;
 
    staffV.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffV.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    it = staffV.begin();  //開(kāi)始位置
    it++;
    //按照位置插入
    staffV.insert(it,new Staff(1003,"sam","1234",MANAGER));
    //尾部刪除
    staffV.pop_back();
 
    for(it=staffV.begin();it<staffV.end();it++)
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }
//    id:1001
//  id:1003
}

6. erase按照位置刪除

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
void demo_vector();
 
int main()
{
    demo_vector();
    return 0;    
}
 
void demo_vector()
{
    vector<Staff *> staffV;
    vector<Staff *>::iterator it;
 
    staffV.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffV.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    it = staffV.begin();  //開(kāi)始位置
    it++;
    //按照位置插入
    staffV.insert(it,new Staff(1003,"sam","1234",MANAGER));
    //尾部刪除
    staffV.pop_back();
 
    it = staffV.begin();  //開(kāi)始位置
    staffV.erase(it);//刪除第一個(gè)
 
    for(it=staffV.begin();it<staffV.end();it++)
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }
//id:1003
}

7.erase按照位置刪除(迭代器指針偏移it++)

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
void demo_vector();
 
int main()
{
    demo_vector();
    return 0;    
}
 
void demo_vector()
{
    vector<Staff *> staffV;
    vector<Staff *>::iterator it;
 
    staffV.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffV.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    it = staffV.begin();  //開(kāi)始位置
    it++;
    //按照位置插入
    staffV.insert(it,new Staff(1003,"sam","1234",MANAGER));
 
    //尾部刪除
    staffV.pop_back();
 
    it = staffV.begin();  //開(kāi)始位置
    it++;
    staffV.erase(it);//刪除第二個(gè)
 
    for(it=staffV.begin();it<staffV.end();it++)
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }
//id:1001
}

8.size計(jì)數(shù)

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
void demo_vector();
 
int main()
{
    demo_vector();
    return 0;    
}
 
void demo_vector()
{
    vector<Staff *> staffV;
    vector<Staff *>::iterator it;
 
    staffV.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffV.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    it = staffV.begin();  //開(kāi)始位置
    it++;
    //按照位置插入
    staffV.insert(it,new Staff(1003,"sam","1234",MANAGER));
 
    cout<<"員工數(shù)量:"<<staffV.size()<<endl;
    for(it=staffV.begin();it<staffV.end();it++)
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }
//員工數(shù)量:3
//id:1001
//id:1003
//id:1002
}

9.容器訪問(wèn)四種

1.迭代器指針  2.at訪問(wèn)方式 3.[ ]中括號(hào)訪問(wèn)方式  4.C++新增auto訪問(wèn)方式

at訪問(wèn)方式:

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
void demo_vector();
 
int main()
{
    demo_vector();
    return 0;    
}
 
void demo_vector()
{
    vector<Staff *> staffV;
    vector<Staff *>::iterator it;
 
    staffV.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffV.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    it = staffV.begin();  //開(kāi)始位置
    it++;
    //按照位置插入
    staffV.insert(it,new Staff(1003,"sam","1234",MANAGER));
 
    cout<<"員工數(shù)量:"<<staffV.size()<<endl;
/*    for(it=staffV.begin();it<staffV.end();it++)//迭代器指針遍歷
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }*/
    for(int i =0;i<staffV.size();i++)  //下標(biāo)法
    {
        cout<<"id:"<<staffV.at(i)->getId()<<endl; 
    }
//員工數(shù)量:3
//id:1001
//id:1003
//id:1002
}

[ ]中括號(hào)訪問(wèn)方式 

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
void demo_vector();
 
int main()
{
    demo_vector();
    return 0;    
}
 
void demo_vector()
{
    vector<Staff *> staffV;
    vector<Staff *>::iterator it;
 
    staffV.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffV.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    it = staffV.begin();  //開(kāi)始位置
    it++;
    //按照位置插入
    staffV.insert(it,new Staff(1003,"sam","1234",MANAGER));
 
    cout<<"員工數(shù)量:"<<staffV.size()<<endl;
/*    for(it=staffV.begin();it<staffV.end();it++)//迭代器指針遍歷
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }*/
    for(int i =0;i<staffV.size();i++)  //下標(biāo)法
    {
        //cout<<"id:"<<staffV.at(i)->getId()<<endl; 
        cout<<"id:"<<staffV[i]->getId()<<endl; 
    }
//員工數(shù)量:3
//id:1001
//id:1003
//id:1002
}

10.clear清空

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
void demo_vector();
 
int main()
{
    demo_vector();
    return 0;    
}
 
void demo_vector()
{
    vector<Staff *> staffV;
    vector<Staff *>::iterator it;
 
    staffV.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffV.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    it = staffV.begin();  //開(kāi)始位置
    it++;
    //按照位置插入
    staffV.insert(it,new Staff(1003,"sam","1234",MANAGER));
 
    cout<<"員工數(shù)量:"<<staffV.size()<<endl;
/*    for(it=staffV.begin();it<staffV.end();it++)//迭代器指針遍歷
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }*/
    for(int i =0;i<staffV.size();i++)  //下標(biāo)法
    {
        //cout<<"id:"<<staffV.at(i)->getId()<<endl; 
        cout<<"id:"<<staffV[i]->getId()<<endl; 
    }
    staffV.clear();
     cout<<"員工數(shù)量:"<<staffV.size()<<endl;
//員工數(shù)量:3
//id:1001
//id:1003
//id:1002
//員工數(shù)量:0
}

八:順序容器--雙端隊(duì)列--deque

a.雙端隊(duì)列是一種放松了訪問(wèn)權(quán)限的隊(duì)列。元素可以從隊(duì)列的兩端入隊(duì)和出隊(duì),也支持通過(guò)下標(biāo)操作符“[]”進(jìn)行直接訪問(wèn)。

b.與向量的對(duì)比 功能上:和向量沒(méi)有多少區(qū)別,

性能上:在雙端隊(duì)列起點(diǎn)上的插入和刪除操作快

頭文件:#include <deque>

1.push_front頭部插入

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
#include<deque>
void demo_deque();
 
int main()
{
    demo_deque();
    return 0;    
}
 
void demo_deque()
{
    deque<Staff *> staffV;
    deque<Staff *>::iterator it;
 
    staffV.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffV.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    it = staffV.begin();  //開(kāi)始位置
    it++;
    //按照位置插入
    staffV.insert(it,new Staff(1003,"sam","1234",MANAGER));
 
    //頭部插入
    staffV.push_front(new Staff(1004,"lilei","1234",MANAGER));
 
    cout<<"員工數(shù)量:"<<staffV.size()<<endl;
/*    for(it=staffV.begin();it<staffV.end();it++)//迭代器指針遍歷
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }*/
    for(int i =0;i<staffV.size();i++)  //下標(biāo)法
    {
        //cout<<"id:"<<staffV.at(i)->getId()<<endl; 
        cout<<"id:"<<staffV[i]->getId()<<endl; 
    }
//    staffV.clear();
//     cout<<"員工數(shù)量:"<<staffV.size()<<endl;
//員工數(shù)量:4
//id:1004
//id:1001
//id:1003
//id:1002
}

2.pop_front頭部刪除

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
#include<deque>
void demo_deque();
 
int main()
{
    demo_deque();
    return 0;    
}
 
void demo_deque()
{
    deque<Staff *> staffV;
    deque<Staff *>::iterator it;
 
    staffV.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffV.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    //頭部插入
    staffV.push_front(new Staff(1004,"lilei","1234",MANAGER));
 
    it = staffV.begin();  //開(kāi)始位置
    //it++;
 
    //按照位置插入
    staffV.insert(it,new Staff(1003,"sam","1234",MANAGER));  // 3 4 1 2
 
    staffV.pop_front();  //頭部刪除
 
    cout<<"員工數(shù)量:"<<staffV.size()<<endl;
/*    for(it=staffV.begin();it<staffV.end();it++)//迭代器指針遍歷
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }*/
    for(int i =0;i<staffV.size();i++)  //下標(biāo)法
    {
        //cout<<"id:"<<staffV.at(i)->getId()<<endl; 
        cout<<"id:"<<staffV[i]->getId()<<endl; 
    }
//    staffV.clear();
//     cout<<"員工數(shù)量:"<<staffV.size()<<endl;
//員工數(shù)量:3
//id:1004
//id:1001
//id:1002
}

九:順序容器 --列表--list

a.鏈表主要用于存放雙向鏈表,可以從任意一端開(kāi)始遍歷。鏈表還提供了拼接(splice)操作,將一個(gè)序列中的元素從插入到另一個(gè)序列中。

b.對(duì)比:元素的插入和刪除操作對(duì) list 而言尤為高效

與 vector 和 deque 相比,對(duì)元素的下標(biāo)訪問(wèn)操作的低效是不能容忍的,因此 list 不提供這類操作。

頭文件:#include <list>

list只支持迭代器法

for(it=staffList.begin();it!=staffList.end();it++)//迭代器指針遍歷

1.只支持迭代器指針遍歷

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
#include<deque>
#include<list>
void demo_list();
 
int main()
{
    demo_list();
    return 0;    
}
 
void demo_list()
{
    list<Staff *> staffList;
    list<Staff *>::iterator it;
 
    staffList.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffList.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    //頭部插入
    staffList.push_front(new Staff(1004,"lilei","1234",MANAGER));
 
    it = staffList.begin();  //開(kāi)始位置
    //it++;
    //按照位置插入
    staffList.insert(it,new Staff(1003,"sam","1234",MANAGER));  // 3 4 1 2
 
    staffList.pop_front();  //頭部刪除
 
    cout<<"員工數(shù)量:"<<staffList.size()<<endl;
    for(it=staffList.begin();it!=staffList.end();it++)//迭代器指針遍歷
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }
//員工數(shù)量:3
//id:1004
//id:1001
//id:1002
}

2.把一個(gè)鏈表(單個(gè)元素)里的東西放到另外一個(gè)鏈表中--splice

#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
#include<deque>
#include<list>
void demo_list();
 
int main()
{
    demo_list();
    return 0;    
}
 
void demo_list()
{
    list<Staff *> staffList;
  
    list<Staff *> list2;//再一個(gè)鏈表
    list2.push_back(new Staff(1006,"mei","1234",ADMIN));//有一個(gè)1006
    
    staffList.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffList.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    //頭部插入
    staffList.push_front(new Staff(1004,"lilei","1234",MANAGER));
 
    list<Staff *>::iterator it;
    it = staffList.begin();  //開(kāi)始位置
    it++;                    //在第二個(gè)位置插入1006
  //splice move element from list to list
    staffList.splice(it,list2);
 
    cout<<"員工數(shù)量:"<<staffList.size()<<endl;
    for(it=staffList.begin();it!=staffList.end();it++)//迭代器指針遍歷
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }
    cout<<"員工數(shù)量:"<<list2.size()<<endl;
//員工數(shù)量:4
//id:1004
//id:1006
//id:1001
//id:1002
//員工數(shù)量:0
}
#include<iostream>
using namespace std;
#include"CStaff.h"
#include<vector>
#include<deque>
#include<list>
void demo_list();
 
int main()
{
    demo_list();
    return 0;    
}
 
void demo_list()
{
    list<Staff *> staffList;
 
    list<Staff *>list2;//再一鏈表
    list2.push_back(new Staff(1006,"mei","1234",ADMIN));  //有1006 1007
    list2.push_back(new Staff(1007,"didi","1234",ADMIN));
 
    staffList.push_back(new Staff(1001,"admin","1234",ADMIN));
    staffList.push_back(new Staff(1002,"lily","1234",ADMIN));
 
    //頭部插入
    staffList.push_front(new Staff(1004,"lilei","1234",MANAGER));
 
    list<Staff *>::iterator it;
    it = staffList.begin();  //開(kāi)始位置
    it++;                    //在第二個(gè)位置插入1006 1007
//splice move element from list to list
    staffList.splice(it,list2);
 
    cout<<"員工數(shù)量:"<<staffList.size()<<endl;
    for(it=staffList.begin();it!=staffList.end();it++)//迭代器指針遍歷
    {
        cout<<"id:"<<(*it)->getId()<<endl; 
    }
    cout<<"員工數(shù)量:"<<list2.size()<<endl;
//員工數(shù)量:5
//id:1004
//id:1006
//id:1007
//id:1001
//id:1002
//員工數(shù)量:0
}

到此這篇關(guān)于C++順序容器(vector、deque、list)的使用詳解的文章就介紹到這了,更多相關(guān)C++ 順序容器內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • C/C++?Qt數(shù)據(jù)庫(kù)與SqlTableModel組件應(yīng)用教程

    C/C++?Qt數(shù)據(jù)庫(kù)與SqlTableModel組件應(yīng)用教程

    SqlTableModel?組件可以將數(shù)據(jù)庫(kù)中的特定字段動(dòng)態(tài)顯示在TableView表格組件中,這篇文章將主要介紹SqlTableModel組件一些常用的操作,需要的朋友可以參考一下
    2021-12-12
  • Qt實(shí)現(xiàn)自定義矩陣布局

    Qt實(shí)現(xiàn)自定義矩陣布局

    這篇文章主要為大家詳細(xì)介紹了Qt實(shí)現(xiàn)自定義矩陣布局,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-08-08
  • C++實(shí)現(xiàn)LeetCode(692.前K個(gè)高頻詞)

    C++實(shí)現(xiàn)LeetCode(692.前K個(gè)高頻詞)

    這篇文章主要介紹了C++實(shí)現(xiàn)LeetCode(692.前K個(gè)高頻詞),本篇文章通過(guò)簡(jiǎn)要的案例,講解了該項(xiàng)技術(shù)的了解與使用,以下就是詳細(xì)內(nèi)容,需要的朋友可以參考下
    2021-08-08
  • C 標(biāo)準(zhǔn)I/O庫(kù)的粗略實(shí)現(xiàn)教程

    C 標(biāo)準(zhǔn)I/O庫(kù)的粗略實(shí)現(xiàn)教程

    下面小編就為大家分享一篇C 標(biāo)準(zhǔn)I/O庫(kù)的粗略實(shí)現(xiàn)教程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2017-12-12
  • Cocos2d-x中獲取系統(tǒng)時(shí)間和隨機(jī)數(shù)實(shí)例

    Cocos2d-x中獲取系統(tǒng)時(shí)間和隨機(jī)數(shù)實(shí)例

    這篇文章主要介紹了Cocos2d-x中獲取系統(tǒng)時(shí)間和隨機(jī)數(shù)實(shí)例,本文代碼含有大量注釋來(lái)講解獲取系統(tǒng)時(shí)間和隨機(jī)數(shù)的方法,需要的朋友可以參考下
    2014-09-09
  • Qt兩種定時(shí)器使用實(shí)現(xiàn)方式

    Qt兩種定時(shí)器使用實(shí)現(xiàn)方式

    這篇文章主要給大家介紹了關(guān)于Qt兩種定時(shí)器使用實(shí)現(xiàn)方式的相關(guān)資料,Qt中的定時(shí)器類是QTimer,QTimer不是一個(gè)可見(jiàn)的界面組件,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2024-01-01
  • C++ 異常處理noexcept正確使用示例詳解

    C++ 異常處理noexcept正確使用示例詳解

    這篇文章主要為大家介紹了C++ 異常處理noexcept正確使用示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-04-04
  • C語(yǔ)言循環(huán)語(yǔ)句之重復(fù)執(zhí)行特定的代碼塊

    C語(yǔ)言循環(huán)語(yǔ)句之重復(fù)執(zhí)行特定的代碼塊

    在C語(yǔ)言中分支和循環(huán)語(yǔ)句是實(shí)現(xiàn)條件執(zhí)行和重復(fù)執(zhí)行的重要工具,下面這篇文章主要給大家介紹了關(guān)于C語(yǔ)言循環(huán)語(yǔ)句之重復(fù)執(zhí)行特定的代碼塊的相關(guān)資料,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2024-01-01
  • C++JSON庫(kù)CJsonObject詳解(輕量簡(jiǎn)單好用)

    C++JSON庫(kù)CJsonObject詳解(輕量簡(jiǎn)單好用)

    CJsonObject是基于cJSON全新開(kāi)發(fā)一個(gè)C++版的JSON庫(kù),CJsonObject的最大優(yōu)勢(shì)是輕量簡(jiǎn)單好用,開(kāi)發(fā)效率極高,對(duì)多層嵌套json的讀取和生成使用非常簡(jiǎn)單,喜歡的朋友一起看看吧
    2021-04-04
  • 美化你的代碼 vb(VBS)代碼格式化的實(shí)現(xiàn)代碼

    美化你的代碼 vb(VBS)代碼格式化的實(shí)現(xiàn)代碼

    雖然VB.NET出現(xiàn)很久了,但還有好多人仍然在使用VB6。我在實(shí)現(xiàn)一些小功能的時(shí)候也喜歡用VB6,畢竟誰(shuí)都不想每天的美好心情被VS那烏龜般的啟動(dòng)速度影響
    2012-05-05

最新評(píng)論

肥西县| 廊坊市| 澳门| 五寨县| 桓台县| 弥勒县| 建湖县| 高清| 平山县| 新源县| 资阳市| 汶上县| 榆社县| 盐津县| 上蔡县| 津南区| 龙山县| 阿巴嘎旗| 崇礼县| 毕节市| 老河口市| 得荣县| 大同县| 平顶山市| 吉木萨尔县| 曲阳县| 莱州市| 咸阳市| 七台河市| 阳西县| 汪清县| 遂溪县| 门头沟区| 莱州市| 梅州市| 类乌齐县| 苍山县| 阿拉尔市| 桦甸市| 平阴县| 马龙县|