Skip to content

Instantly share code, notes, and snippets.

@j2doll
Created August 12, 2017 07:30
Show Gist options
  • Save j2doll/81e2a562c10a211623fd5270cc426987 to your computer and use it in GitHub Desktop.
Save j2doll/81e2a562c10a211623fd5270cc426987 to your computer and use it in GitHub Desktop.
constparam
// constparam
// 읽기(R) 쓰기(W) 인자. read/write paramter.
void refparam(int& param)
{
param = 10;
}
// 읽기전용 인자를 const로 설정. set the read-only parameter to const type.
void constparam(const int& param)
{
// param = 10; // error: you cannot assign to a variable that is const
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment