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 <string> #include <iostream>
void func(std::string &hello) { std::cout << hello.size(); std::cout << hello.capacity(); }
int main () { std::string hello{"hello, world!!!"}; hello += "this is a test"; func(hello); std::cout << "Program end\n"; return 0; }
|