20.07.2015, 11:40
There are more diffrences...
static saves the pointer of an variable in the stack/heap.
For example:
And if you use for example:
static saves the pointer of an variable in the stack/heap.
For example:
PHP код:
stock func()
{
static a;
printf("%d",++a);
}
//main()
func(); //It will print 1
func(); //It will print 2
PHP код:
//in the include
static x;
//You can use in the main mode
new x; //without problems