xuejianhui

导航

2012年11月23日 #

vector操作笔记

摘要: //★ 使用迭代器操作vector : vector<double>::iterator pd; // pd an itertor(迭代器). vector<double>scorces; pd = scorces.begin(); // hava pd point to the first elemet. *pd = 22.3; // dereference pd and assign value to first element. ++pd; // make pd point to the ... 阅读全文

posted @ 2012-11-23 16:08 xuejianhui 阅读(234) 评论(0) 推荐(0) 编辑

vector.cpp -- introducing the vector template.

摘要: vector.cpp -- introducing the vector template.//vector.cpp -- introducing the vector template.#include <iostream>#include <string>#include <vector>const int NUM = 5;int main(){ using std::vector; using std::string; using std::cin; using std::cout; using std::endl; vector<int> 阅读全文

posted @ 2012-11-23 15:21 xuejianhui 阅读(260) 评论(0) 推荐(0) 编辑