20.07.2015, 10:54
As the title says, anyone can explain me?
I think ****** once said:
"If you don't know the difference between 'new' and 'static', then don't use it" |
stock func()
{
static a;
printf("%d",++a);
}
//main()
func(); //It will print 1
func(); //It will print 2
//in the include
static x;
//You can use in the main mode
new x; //without problems
Bullshit...
If he don't know the difference between "new" and "static" he ask. So, he did it. The difference between "static" and "new" is, that the declaration of "static" can used also in filterscripts, includes and gamemodes at the same time.. The declaration of "new" can't used in filterscripts, includes and gamemodes at the same time. - Mencent |
Oh ok, but 1 more question. I have an include called def.inc which has all of my arrays, enums, defines and other vars stored. If i create a connection handle for mysql in that include with static, it gives undefined symbol error, but if i create it with new, it works fine. Why is that?
|