Warning C26462
The value pointed to by 'variable' is assigned only once, mark it as a pointer to
const
(con.4).
Remarks
Pointers to variables whose values remain unchanged should be marked as const
.
Code analysis name: USE_CONST_POINTER_FOR_VARIABLE
Example
void useVal(int val);
void function1(int* ptr)
{
int* p = ptr; // C26462, the value pointed to by p is unmodified
ptr = nullptr;
useVal(*p);
}
See also
คำติชม
https://aka.ms/ContentUserFeedback
เร็วๆ นี้: ตลอดปี 2024 เราจะขจัดปัญหา GitHub เพื่อเป็นกลไกคำติชมสำหรับเนื้อหา และแทนที่ด้วยระบบคำติชมใหม่ สำหรับข้อมูลเพิ่มเติม ให้ดู:ส่งและดูข้อคิดเห็นสำหรับ