Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The variable 'variable' is assigned only once, mark it as
const
.
See also
Example
int GetTheNumber();
int GiveMeTheNumber(int);
void function1()
{
int theNumber = GetTheNumber(); // C26496, 'theNumber' is never assigned to again, so it can be marked as const
std::cout << theNumber << '\n';
GiveMeTheNumber(theNumber);
// ...
}