Diferencias: static - new.
#3

La mejor manera es con un ejemplo
Код:
// Se llaman estas dos funciones
foo();
bar();

foo()
{
	static a = 5; // se crea variable "a" en la memoria con valor a 5
}

bar()
{
	static a; // a ya es 5, solo se esta "recuperando" de la memoria
	printf("a = %d", a); // a = 5
}
Reply


Messages In This Thread
Diferencias: static - new. - by Unrea1 - 15.09.2015, 09:42
Respuesta: Diferencias: static - new. - by oOFotherOo - 15.09.2015, 14:50
Re: Diferencias: static - new. - by admantis - 15.09.2015, 15:08
Respuesta: Diferencias: static - new. - by bm0z - 15.09.2015, 17:31
Re: Diferencias: static - new. - by MaRcOsWeB - 15.09.2015, 19:54
Respuesta: Diferencias: static - new. - by bm0z - 15.09.2015, 21:42
Re: Diferencias: static - new. - by Unrea1 - 15.09.2015, 22:53
Respuesta: Diferencias: static - new. - by bm0z - 15.09.2015, 23:03
Re: Diferencias: static - new. - by Unrea1 - 15.09.2015, 23:14
Re: Diferencias: static - new. - by MaRcOsWeB - 15.09.2015, 23:26

Forum Jump:


Users browsing this thread: 2 Guest(s)