#include <iostream>
void f1(){
//szは定数
const int sz = 10;
const_cast<int&>(sz) = 15;
char a[sz];
std::cout << sz << " : " << sizeof(a) << std::endl;
}
void f2(const int sz){
//szはconst変数
const_cast<int&>(sz) = 15;
char a[sz];
std::cout << sz << " : " << sizeof(a) << std::endl;
}
int main(){
f1();
f2(10);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdm9pZCBmMSgpewogICAvL3N644Gv5a6a5pWwCiAgIGNvbnN0IGludCBzeiA9IDEwOwogICBjb25zdF9jYXN0PGludCY+KHN6KSA9IDE1OwogICBjaGFyIGFbc3pdOwogICBzdGQ6OmNvdXQgPDwgc3ogPDwgIiA6ICIgPDwgc2l6ZW9mKGEpIDw8IHN0ZDo6ZW5kbDsKfQp2b2lkIGYyKGNvbnN0IGludCBzeil7CiAgIC8vc3rjga9jb25zdOWkieaVsAogICBjb25zdF9jYXN0PGludCY+KHN6KSA9IDE1OwogICBjaGFyIGFbc3pdOwogICBzdGQ6OmNvdXQgPDwgc3ogPDwgIiA6ICIgPDwgc2l6ZW9mKGEpIDw8IHN0ZDo6ZW5kbDsKfQppbnQgbWFpbigpewogICBmMSgpOwogICBmMigxMCk7CiAgIHJldHVybiAwOwp9Cg==