01.cpp

ポインタ

vectorクラス、動的配列

動的に配列サイズが拡張される #include <vector> #include <iostream> void printAll(const std::vector<int>&); int main() { using std::vector; vector<int> ary(10); ary[0] = 1; // 配列のような使用が可能 ary.at(1) = 2; // ary[1] = 2とほぼ等価 printAll(ary); ary.resize(2); </int></int></iostream></vector>…

cpp helloworld

#include <iostream> using namespace std; int main() { cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! return 0; }</iostream>