CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <vector>
using namespace std;
void* operator new(size_t s)
{
cout << "allocating " << s << endl;
return malloc(s);
}
void demoStrings()
{
string s{};
cout << endl;
string s1{"012345"};
cout << endl;
string s2{"0123456789012345"};
cout << endl;
}
void demoVectorString()
{
vector<string> v;
v.reserve(3);
v.emplace_back("");
cout << endl;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run