#include "opencv2/objdetect.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
using namespace std;
using namespace cv;
int main()
{
std::vector<int> vec;
vec.push_back();
vec.push_back();
vec.push_back();
vec.push_back();
cout<<vec[]<<endl;
vector<int>::iterator it;
for(it=vec.begin();it!=vec.end();it++){
cout<<"vector:"<<*it<<endl;
}
vec.insert(vec.begin()+,);
cout<<vec[]<<endl;
vec.erase(vec.begin()+);
cout<<vec[]<<endl;
cout<<vec.size()<<endl; getch();
return ;
}

C++——Vector的更多相关文章

  1. c++ vector 使用

    1. 包含一个头文件: 1 #include <vector> 2. 申明及初始化: std::vector<int> first; // empty vector of in ...

  2. Vector Tile

    Mapbox Vector Tile Specification A specification for encoding tiled vector data. <?XML:NAMESPACE ...

  3. ArrayList、Vector、LinkedList的区别联系?

    1.ArrayList.Vector.LinkedList类都是java.util包中,均为可伸缩数组. 2.ArrayList和Vector底层都是数组实现的,所以,索引数据快,删除.插入数据慢. ...

  4. ArrayList、Vector、HashMap、HashSet的默认初始容量、加载因子、扩容增量

    当底层实现涉及到扩容时,容器或重新分配一段更大的连续内存(如果是离散分配则不需要重新分配,离散分配都是插入新元素时动态分配内存),要将容器原来的数据全部复制到新的内存上,这无疑使效率大大降低. 加载因 ...

  5. Java中Vector和ArrayList的区别

    首先看这两类都实现List接口,而List接口一共有三个实现类,分别是ArrayList.Vector和LinkedList.List用于存放多个元素,能够维护元素的次序,并且允许元素的重复.3个具体 ...

  6. C++使用vector

    #include <iostream> #include <string> #include <vector> using namespace std; void ...

  7. [LeetCode] Flatten 2D Vector 压平二维向量

    Implement an iterator to flatten a 2d vector. For example,Given 2d vector = [ [1,2], [3], [4,5,6] ] ...

  8. C++ 数组array与vector的比较

    转:http://blog.csdn.net/yukin_xue/article/details/7391897 1. array 定义的时候必须定义数组的元素个数;而vector 不需要: 且只能包 ...

  9. vector定义初始化

    头文件 #include<vector> using std::vector; vector<T> v1; vector<T> v2(v1); vector< ...

  10. vector迭代器用法

    #include<iostream> #include<vector> using namespace std; int main() { vector<int> ...

随机推荐

  1. [转]TopShelf 用法

    static void Main(string[] args) { { x.Service<SyncData>(s => { s.ConstructUsing(name => ...

  2. Thinkpad 小红点飘移的不完美解决办法

    环境:T420 BIOS1.49 windows7 x64 对硬盘执行写入操作,比如说建立一个空白记事本,每次飘移的时候,就alt+tab切到记事本,随便输入一个字符,ctrl+s保存,搞定.

  3. WPF 引用 ttf文件

    1.在 http://www.iconfont.cn/ 下载图标,将图标加入购物车中,统一下载 2.下载到本地,解压后文件夹如下图.打开 demo_unicode.html 可以查看下载的图标信息和引 ...

  4. WPF 播放声音 百度文字转声音

    https://developer.baidu.com/vcast  google浏览器可下载 https://www.cnblogs.com/maruko/archive/2013/04/19/WP ...

  5. MySQL按周统计 WEEK 实例

    MySQL按周统计每周数据总和,用到了WEEK,subdate,date_format,date_sub,date_add函数. WEEK() 查看给定日期周数,语法:WEEK(date, mode) ...

  6. 面试题_默认传参list

    # ###2.值是多少 def extendList(val, list=[]): list.append(val) return list 如果默认形参是列表,会提前在内存中开辟一个空间存储列表 如 ...

  7. idea spring boot docker 多项目 maven 编译

    1,重复的model [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while proc ...

  8. 用kickstart创建逻辑卷管理LVM分区

    创建两个物理分区分别给Boot和Swap分区,剩余的空间作LVM. Partition    Size    Name------------------------------/boot       ...

  9. 8 种常被忽视的 SQL 错误用法

      来源:db匠 yq.aliyun.com/articles/72501 sql语句的执行顺序: FROM <left_table> ON <join_condition> ...

  10. bootstrap的使用集锦

    在使用div样式的时候可以根据页面布局来调整大小 <div class="col-md-8 col-md-offset-3"># col-md-8 div所占的空间大小 ...