0
please help me):) what's the problem code??
#include <cstdlib> #include <iostream> #include <graphics.h> using namespace std; void rand_rect() { int x1,x2,y1,y2,R,G,B; x1=rand()%getmaxx(); y1=rand()%getmaxy(); x2=rand()%getmaxx(); y2=rand()%getmaxy(); R=rand()%256; G=rand()%256; B=rand()%256; stecolor(COLOR(R,G,B)); rectangle(x1,y1,x2,y2); } int main() { srand(time(NULL)); initwindow(1200,800,"",-3,-3); while(!kbhit()) { rand_rect(); delay(100); } closegraph(); return 0; }
7 Answers
0
srand (time (null)):
this was the error ) 'time' was not declaled in this scope
0
you forgot to include time.h
#include <time.h>
0
tnx for answer
is <time.h>= <ctime>??
0
yes
0
aging error has
recipe for target 'projectl.exe'failed
0
#include<ctime>
srand(time(NULL)); //using the time seed from srand
0
tnxd gays