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

Guideline:  7.4.8#2Checked automatically with code checker

Synopsis:Wherever possible, use sizeof entity; rather than sizeof (type);
Language:C
Severity Level:6
Category:EXPRESSIONS


Description:
If the type of value_ptr is changed, the preferred form takes account of this automatically. Note however that whereas sizeof (a local array) is the actual size of the array, sizeof (a formal parameter denoting an array) is the size of the pointer, (to which it is automatically converted).

Example:

double *value_ptr;
...
sizeof *value_ptr; /* Preferred to ... */
sizeof (double); /* this. */