2013-08-27から1日間の記事一覧

C++のconstの復習

C++

よくわからなくなるのでメモ。 ポインタ変数につけるconst ポインタ変数に対してconstをつけるときは、場所によって効果が違う。 #include <iostream> using namespace std; int main(){ int a = 100; int b = 100; // ポインタが指す先を変更できない const int* p = </iostream>…