C++相談室 part166 (635レス)
C++相談室 part166 http://mevius.5ch.net/test/read.cgi/tech/1745631298/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
615: デフォルトの名無しさん (ワッチョイ dbd6-ERpe) [sage] 2025/09/07(日) 17:20:59.28 ID:yhbLpr+z0 >>614 c/c++なら、ポインタなのか参照なのか見ればわかるし、 まずコンパイラが型をチェックしますんで。はい http://mevius.5ch.net/test/read.cgi/tech/1745631298/615
618: デフォルトの名無しさん (ワントンキン MMe6-+IOe) [sage] 2025/09/07(日) 22:03:02.60 ID:2DaEs5aKM >>615 C++では参照の競合があってもエラーとならず安全性は保証されないよ 例えば以下の挙動 std::vector<int> v{0, 1, 2, 3, 4, 5, 6, 7}; int& fifth = v[5]; v.push_back(100); std::vector<int> w{8, 8, 8, 8, 8, 8, 8, 8}; fifth = 555; std::cout << "v[5] = " << v[5] << std::endl; std::cout << "w[5] = " << w[5] << std::endl; http://mevius.5ch.net/test/read.cgi/tech/1745631298/618
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.026s