-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring_capacity_methods.cpp
50 lines (46 loc) · 1.11 KB
/
string_capacity_methods.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <bits/stdc++.h>
using namespace std;
int main()
{
// string s = "Hello";
// cout << s << endl
// << s.size() << endl;
// s = "Gello Re";
// cout << s << endl
// << s.size() << endl;
// string s1 = "Hello";
// string s2 = "Hello";
// if (s1 == s2)
// {
// cout << "Same" << endl;
// }
// else
// {
// cout << "Not Same" << endl;
// }
// String capacity Metods
// string s = "Hello World";
// cout << s.size() << endl;
// cout << s.capacity() << endl;
// s = "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH";
// cout << s.size() << endl;
// cout << s.capacity() << endl;
// cout << s.max_size() << endl;
// string s = "Hello";
// cout << s << endl;
// cout << s.size() << endl;
// s.clear();
// cout << s.size();
// string s = "Hello";
// // s.clear();
// if (s.empty())
// cout << "Empty" << endl;
// else
// cout << "Not Empty" << endl;
string s;
cin >> s;
s.resize(5);
s.resize(8, '-');
cout << s << endl;
return 0;
}