일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Docker
- tour of go
- C++
- c++ heap
- 자료구조
- 코딩
- a tour of go
- gui
- BOJ
- vim-go
- 알고리즘
- 연결리스트
- C언어
- 백준
- C++ gui
- LOB
- JUCE 튜토리얼
- go channel
- JUCE
- OS
- 운영체제
- 프로그래밍
- go
- 리듬게임
- C++ gui 라이브러리
- C++ library
- JUCE library
- JUCE라이브러리
- 공룡책
- Nebula
Archives
- Today
- Total
CafeM0ca
[C++]mutable 본문
반응형
mutable은 const나 static, register, extern과 같은 키워드다.
역할은 const선언된 구조체나 클래스에서 값을 바꿀 수 있도록 도와준다.
1 2 3 4 5 6 7 8 9 10 11 12 | struct student{ char name[20]; int IQ; mutable int age; }; int main(void){ //상수화된 구조체 struct student const me={"M0ca",111,17}; //me.IQ=130 안된다. me.age=18; //된다. return 0; } | cs |
반응형
'Programming > C++' 카테고리의 다른 글
[C++]형변환(typecasting) (0) | 2018.01.22 |
---|---|
[C++]class static 멤버변수 (0) | 2018.01.06 |
[C++]템플릿 (0) | 2018.01.03 |
[C++] 런타임 과정에서의 입력 값 (0) | 2017.12.02 |
[C++]inline (0) | 2017.11.29 |
Comments