일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 회원가입
- finance & economics
- c
- 프로그래머스
- C++
- Gem
- CS
- 파이썬
- SECS/GEM
- ai이미지변환
- 백준
- Cars
- python
- 지브리필터
- 자바
- Spring JPA
- coins
- Digital Marketing
- 비트코인
- SECS-II
- programmers
- Baekjoon
- modern c++
- Investing
- java
- spring boot
- 암호화폐투자
- Spring
- Computer Science
- SECS
Archives
- Today
- Total
비버놀로지
[Mordern C++] reference - 참조자 본문
반응형
reference - 참조자
- 자신이 참조하는 변수를 대신할 수 있는 또 하나의 이름
- 생성시 초기화 필요
- reference 참조, 8byte copy, 원본 변경 가능
int a; int &c = a; |
int a = 3; | a | |||||
3 | |||||||
int arr[10]; for (int &x : arr {...} |
int &b = a; int c = a; |
a b | c | ||||
3 | 3 | ||||||
void func (int &b) {...} int a; func (a); |
b = 5; c = 6; |
||||||
5 | 6 | ||||||
반응형
'LANGUAGE STUDY > C C++' 카테고리의 다른 글
[Modern C++] Template (0) | 2023.01.16 |
---|---|
[mordern C++] auto (0) | 2023.01.16 |
[Modern C++] Pair (0) | 2023.01.16 |
[C++] STL (0) | 2023.01.16 |
[C \ C++] 1. VS code에서 C\C++ 시작하기 (0) | 2021.03.27 |
Comments