[SDL] Strangle problem using keys

Gerry JJ trick at icculus.org
Tue Nov 1 12:54:37 PST 2005


På Tue, 01 Nov 2005 20:36:27 +0100, skrev ALTAIR - <altairdiv at hotmail.com>:
> If (keys[SDLK_UP]== 1)
>
> is the same what:
>
> If (keys[SDLK_UP])

No.  Compile and run this:

--- 8< ---
#include <stdio.h>

void foo (int a)
{
	printf("foo %i\n", a);
	if (a == 1)
		printf("a == 1!\n");
	if (a)
		printf("a!\n");
}

int main (int argc, char *argv[])
{
	foo(0);
	foo(1);
	foo(2);
	return 0;
}
--- 8< ---

- Gerry




More information about the SDL mailing list