declares a static variable
static
static x;
In a function, declares variable x of type ´static´.
This variable will be unknown outside the function.
Its value will not be lost in the output function.
Examples
static x;
Declares variable x of type static.
static x=-3;
Declares variable x of type staticet and initialises it to -3.
static x,y;
Declares variables x and y of type static
static x,y=1
Declares variables x and y of type static, and initializes y to 1.
Notes:
1) Evaluable expression must be parenthesized
Examples:
static z=(1,-1,2);
z is ititialized to (1,-1,2).
static z=[1,5];
z is ititialized to (1,2,3,4,5).
2) Evaluable expression must contain only constant terms
3) To initialize a static array to zero we write: static tab[dim];
Example:
static x[100];
Declares x as an array of 100 static initialized to 0
See also: