Problem in graph () in Windows 8

error in code

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
31
 #include<iostream.h>
 #include<conio.h>
 #include<stdlib.h>
 #include<graphics.h>
 #include<iostream.h>


 void main()
 {
	clrscr();
	int  x,y,r,c;
	graph ();
	srand(time(NULL));

	while(!kbhit())
	{
		c=rand()%15+1;
		x=rand()%getmaxx();
		y=rand()%getmaxy();
		r=1;
		setfillstyle(1,c);
		while(r<=100)
		{
			setcolor(c);
			fillellipse(x,y,r,r);
			r+=1;
			delay(11);
		}
	}
	closegraph();
 }

Error:
Compiling screensaver.cpp:
Error screensaver.cpp 13:Function 'graph' should have prototype


help me!
Last edited on
redundant #include<iostream.h>

put graph()'s definition (or prototype) above the main() function
Last edited on

It does not show anything, and quickly returns to IDE
Do you perhaps mean initgraph()?
Error screensaver.cpp 13:too few paremeters in call to 'initgraph(int far*,int far*,const far*)'
Are you even bothering to look at the documentation for this stuff?
How do you know functions like fillellipse() exist if you don't have some kind of reference?

I tried this on another computer and it worked in windows xp
Topic archived. No new replies allowed.