TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C++ Coding Standard
Search

Rule:  CFL#006Checked automatically with code checker

Synopsis:Do not apply sizeof to an expression with side-effects
Language:C++
Severity Level:1
Category:Control Flow


Description:

The operand of sizeof is not evaluated, so any intended side-effects will not occur.

Example:

size_t Size = sizeof(nCount++);	// Wrong: nCount not changed!