I need to stop this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <allegro.h>
#include <cmath>

void init();
void deinit();

int main() {
init();

while (!key[KEY_ESC]) 
{
int xpn, ypn, xkn, ykn, d=50;
do
{
srand(time(NULL));
xpn = rand()%640;
ypn = rand()%480;
xkn = rand()%640;
ykn = rand()%480;

line(screen,xpn,ypn,xkn,ykn,makecol(255,255,255));
d=d-1;
}
while(d!=0);
}

deinit();
return 0;
}
END_OF_MAIN()

I cant make it stop. I've already tried everything I know, but i cant do this. It should stop after loop but it doesn't. I'm still learning that code language so please be understanding if it is silly mistake.
I believe it's line 10.
key and KEY_ESC aren't defined anywhere. I'm assuming its defined in your <allegro.h> header? Also, is key an array or a function? I would be surprised if it were an array.
Topic archived. No new replies allowed.