/** =====================================================================================** Filename: vec.cpp** Description:** Version: 1.0* Created: 2015年04月01日 01:31:51* Revision: none* Compiler: gcc** Author: zt (),* Organization:** =====================================================================================*/#include <stdlib.h>#include <stdio.h>#include <vector>#include <algorithm>#include <iostream>typedef std::vector<char> vechar_t;std::vector<int> Test(){return {0, 1, 3, 5, 7, 2, 4, 6, 8};}int main ( int argc, char* argv[] ){( void ) argc;( void ) argv;vechar_t vechar;//vechar.reserve ( 100 );//vechar.resize ( 30, 0 );//fprintf ( stderr, "size=%d capacity=%d\n",//( int ) vechar.size(), ( int ) vechar.capacity() );//vechar.clear();//fprintf ( stderr, "size=%d capacity=%d\n",//( int ) vechar.size(), ( int ) vechar.capacity() );vechar_t c{1, 2, 3, 4, 5, 6, 7, 8, 9};c.erase(std::remove_if(c.begin(), c.end(), [] ( int x ){return x % 2 == 0;} ), c.end());//for ( auto& e : c )//fprintf ( stderr, "%d ", e );//for( auto& e : Test())//std::cout<<e<<std::endl;std::vector<std::vector<int>> vv;vv.resize ( 10 );for ( auto& e : vv )std::cout << "size=" << e.size() << std::endl;//vechar.clear();//char buf[10];//char buf2[20];//vechar.insert ( vechar.end(), buf, buf + 10 );//vechar.insert ( vechar.end(), buf2, buf2 + 20 );//for ( int i = 0; i < vechar.size(); ++i )//printf ( "%02x ", vechar[i] );return 0;}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。