⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vectoroverflow.cpp

📁 希望我提供的代码对大家有帮助
💻 CPP
字号:
//: C20:VectorOverflow.cpp

// From Thinking in C++, 2nd Edition

// Available at http://www.BruceEckel.com

// (c) Bruce Eckel 1999

// Copyright notice in Copyright.txt

// Shows the copy-construction and destruction

// That occurs when a vector must reallocate

// (It maintains a linear array of elements)

#include "Noisy.h"

#include "../require.h"

#include <vector>

#include <iostream>

#include <string>

#include <cstdlib>

using namespace std;



int main(int argc, char* argv[]) {

  requireArgs(argc, 1);

  int size = 1000;

  if(argc >= 2) size = atoi(argv[1]);

  vector<Noisy> vn;

  Noisy n;

  for(int i = 0; i < size; i++)

    vn.push_back(n);

  cout << "\n cleaning up \n";

} ///:~

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -