J's Study log

[C++] const 본문

Computer Language/C++

[C++] const

정우섭 2020. 2. 8. 17:07

Const Function

1
void ShowRecInfo() const;
cs

It means 'In this function the value of member variable will not be changed'.

 

In const function you can only call const functions, otherwise a compile error will occur.

'Computer Language > C++' 카테고리의 다른 글

[C++] Inheritance  (0) 2020.03.10
[C++] Class / Struct  (0) 2020.03.08
[C++] new & delete  (0) 2020.02.22
[C++] Different length of String - not  (0) 2020.02.20
[C++] Overloading, Default value  (0) 2020.02.08
Comments