-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext.cpp
More file actions
22 lines (20 loc) · 736 Bytes
/
text.cpp
File metadata and controls
22 lines (20 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
void test(std::string &data) {
std::cout << "test function number 1 data: " << data << "\n";
(data)[0] = 'B';
std::cout << "test function number 2 data: " << data << "\n";
}
int main() {
// std::string my_string = "Hello!";
// std::cout << "Main function number 1 data: " << my_string << "\n";
// test(my_string);
// std::cout << "Main function number 2 data: " << my_string << "\n";
std::string my_string = "Hello!";
std::string my_string_2 = my_string;
std::cout << "1: " << my_string << "\n";
std::cout << "2: " << my_string_2 << "\n";
my_string[0] = 'B';
std::cout << "3: " << my_string << "\n";
std::cout << "4: " << my_string_2 << "\n";
return 0;
}