-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcppString.cpp
More file actions
48 lines (44 loc) · 1.77 KB
/
cppString.cpp
File metadata and controls
48 lines (44 loc) · 1.77 KB
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
#include <iostream>
#include <string>
#include <typeinfo>
class CFXWisePointerC {
public:
CFXWisePointerC(std::string pV):Pvalues_(pV) {
std::cout << "\t\t\t*****CFXWisePointerC: Con is called" << std::endl;
}
~CFXWisePointerC() {
std::cout << "\t\t\t~~~~CFXWisePointerC: De-Con is called" << std::endl;
}
void display(void) {
std::cout << "\t\t\tCFXWisePointerC: name is:" << CName_ << std::endl;
std::cout << "\t\t\tCFXWisePointerC: Pvalues is:" << Pvalues_ << std::endl;
std::cout << "\t\t\tCFXWisePointerC: CName_ size:" << CName_.size() << std::endl;
std::cout << "\t\t\tCFXWisePointerC: Pvalues size:" << Pvalues_.size() << std::endl;
}
private:
std::string CName_{"CFXWisePointerC"};
std::string Pvalues_{"Pvalues"};
};
void cfx_string(void)
{
std::cout << "\tenter " << __func__ << std::endl;
std::string cfxwpc ("cfx");
std::cout << "\t" << __func__ << ":cfxwpc type: "<< typeid(cfxwpc).name() << std::endl;
std::cout << "\t" << __func__ << ":cfxwpc string size: "<< cfxwpc.size() << std::endl;
std::cout << "\t" << __func__ << ":cfxwpc string len: "<< cfxwpc.length() << std::endl;
std::cout << "\t" << __func__ << ":cfxwpc string capacity: "<< cfxwpc.capacity() << std::endl;
std::string cfxwpd ("cfx");
cfxwpd.reserve(30);
std::cout << "\t" << __func__ << ":cfxwpd type: "<< typeid(cfxwpd).name() << std::endl;
std::cout << "\t" << __func__ << ":cfxwpd string size: "<< cfxwpd.size() << std::endl;
std::cout << "\t" << __func__ << ":cfxwpd string len: "<< cfxwpd.length() << std::endl;
std::cout << "\t" << __func__ << ":cfxwpd string capacity: "<< cfxwpd.capacity() << std::endl;
std::cout << "\texit " << __func__ << std::endl;
return;
}
int main() {
std::cout << "main: enter" << std::endl;
cfx_string();
std::cout << "main: exit" << std::endl;
return 0;
}