What's the difference between static and new?
#5

There are more diffrences...

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 
And if you use for example:

PHP код:
//in the include
static x;
//You can use in the main mode
new x//without problems 
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)