您好,欢迎光临本网站![请登录][注册会员]  
文件名称: C和C++函数参考手册.chm
  所属分类: C++
  开发工具:
  文件大小: 176kb
  下载次数: 1
  上传时间: 2009-10-06
  提 供 者: dffgsfs********
 详细说明: 绝对经典 物超所值,经典收藏 内容如下: General C/C++ Pre-processor commands Operator Precedence Escape Sequences ASCII Chart Data Types Keywords Standard C Library Standard C I/O Standard C String & Character Standard C Math Standard C Time & Date Standard C Me mory Other standard C functions All C Functions C++ C++ I/O C++ Strings Miscellaneous C++ C++ Standard Template Library C++ Vectors C++ Double-Ended Queues C++ Lists C++ Priority Queues C++ Queues C++ Stacks C++ Sets C++ Multisets C++ Maps C++ Multimaps C++ Bitsets Iterators 以vector为例: C++ Vectors Vectors contain contiguous elements stored as an array. Accessing members of a vector or appending elements can be done in constant time, whereas locating a specific value or inserting elements into the vector takes linear time. Display all entries for C++ Vectors on one page, or view entries individually: Container constructors create vectors and initialize them with some data Container operators compare, assign, and access elements of a vector assign assign elements to a vector at returns an element at a specific location back returns a reference to last element of a vector begin returns an iterator to the beginning of the vector capacity returns the number of elements that the vector can hold clear removes all elements from the vector empty true if the vector has no elements end returns an iterator just past the last element of a vector erase removes elements from a vector front returns a reference to the first element of a vector insert inserts elements into the vector max_size returns the maximum number of elements that the vector can hold pop_back removes the last element of a vector push_back add an element to the end of the vector rbegin returns a reverse_iterator to the end of the vector rend returns a reverse_iterator to the beginning of the vector reserve sets the minimum capacity of the vector resize change the size of the vector size returns the number of items in the vector swap swap the contents of this vector with another 以vector中的at为例: at Syntax: TYPE& at( size_type loc ); const TYPE& at( size_type loc ) const; The at() function returns a reference to the element in the vector at index loc. The at() function is safer than the [] operator, because it won't let you reference items outside the bounds of the vector. For example, consider the following code: vector v( 5, 1 ); for( int i = 0; i < 10; i++ ) { cout << "Element " << i << " is " << v[i] << endl; } This code overrunns the end of the vector, producing potentially dangerous results. The following code would be much safer: vector v( 5, 1 ); for( int i = 0; i < 10; i++ ) { cout << "Element " << i << " is " << v.at(i) << endl; } Instead of attempting to read garbage values from memory, the at() function will realize that it is about to overrun the vector and will throw an exception. Related topics: (C++ Multimaps) Container operators Container operators ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: C C++ 函数参考手册 chm
 输入关键字,在本站1000多万海量源码库中尽情搜索: