MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl_cpp/samples/string/string2/main.cpp:72–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72int main(int argc, char *argv[]) {
73 int ch;
74 bool move = false;
75
76 while ((ch = getopt(argc, argv, "hm")) > 0) {
77 switch (ch) {
78 case 'h':
79 usage(argv[0]);
80 return 0;
81 case 'm':
82 move = true;
83 break;
84 default:
85 break;
86 }
87 }
88
89 acl::string s1 = "hello world!";
90 std::string s2 = s1;
91 s2 += ", ";
92 s2 += s1;
93
94 printf("s1=%s, s2=%s\r\n", s1.c_str(), s2.c_str());
95 std::cout << "s1=" << s1 << ", s2=" << s2 << std::endl;
96
97 for (int i = 0 ; i < 2; i++) {
98 if (s1 == s2) {
99 printf("strings equal!\r\n");
100 } else {
101 printf("strings not equal!\r\n");
102 }
103
104 s2.clear();
105 s2 += s1;
106 }
107
108 test();
109 test_main(move);
110
111#ifdef WIN32
112 printf("enter any key to exit\r\n");
113 getchar();
114#endif
115 return (0);
116}

Callers

nothing calls this directly

Calls 6

usageFunction · 0.70
testFunction · 0.70
test_mainFunction · 0.70
getoptFunction · 0.50
c_strMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…