-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
30 lines (23 loc) · 729 Bytes
/
Copy pathtest.cpp
File metadata and controls
30 lines (23 loc) · 729 Bytes
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
#include <bits/stdc++.h>
#define endl "\n"
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef tuple<int,int,int> tp;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector <ll> vl;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
int main(){
// ios_base::sync_with_stdio(false);
// cin.tie(nullptr); cout.tie(nullptr);
std::string a = "Hello World";
string b;
std::cout << "a: \"" << &a << "\"\n"; // a는 비어있음
std::cout << "b: \"" << &b << "\"\n"; // b가 원래 값 가져감
b = std::move(a); // 이동
std::cout << "a: \"" << &a << "\"\n"; // a는 비어있음
std::cout << "b: \"" << &b << "\"\n"; // b가 원래 값 가져감
}