chapter6-9.cpp
来自「STL程序员开发指南源码」· C++ 代码 · 共 18 行
CPP
18 行
//文件名:CHAPTER6-9.cpp
#pragma warning(disable:4786)
#include <iostream.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
PrintIt (char* & StringToPrint) { cout << StringToPrint << endl; }
void main (void)
{ vector<char* > FruitAndVegetables;
FruitAndVegetables.push_back("carrot");
FruitAndVegetables.push_back("pumpkin");
FruitAndVegetables.push_back("potato");
FruitAndVegetables.push_back("apple");
FruitAndVegetables.push_back("pineapple");
for_each (FruitAndVegetables.begin(), FruitAndVegetables.end(), PrintIt);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?