Main Content

Number of Local Static Variables

Total number of local static variables in function

Description

This metric provides the number of local static variables in a function.

Examples

expand all

void func(void) {
  static int var_1 = 0;
  int var_2;
}

In this example, the number of static variables in func is 1. For examples of different types of variables, see Number of Local Non-Static Variables.

Metric Information

Group: Function
Acronym: LOCAL_STATIC_VARS
HIS Metric: No

Version History

Introduced in R2017a