please help me):) what's the problem code?? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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; }

17th Jun 2016, 10:22 AM
amin doreh
amin doreh - avatar
7 ответов
0
srand (time (null)): this was the error ) 'time' was not declaled in this scope
17th Jun 2016, 10:26 AM
amin doreh
amin doreh - avatar
0
you forgot to include time.h #include <time.h>
17th Jun 2016, 10:45 AM
Hooman
Hooman - avatar
0
tnx for answer is <time.h>= <ctime>??
17th Jun 2016, 10:49 AM
amin doreh
amin doreh - avatar
0
yes
17th Jun 2016, 10:53 AM
Hooman
Hooman - avatar
0
aging error has recipe for target 'projectl.exe'failed
17th Jun 2016, 10:53 AM
amin doreh
amin doreh - avatar
0
#include<ctime> srand(time(NULL)); //using the time seed from srand
17th Jun 2016, 11:41 AM
VISHAL PRAJAPATI
VISHAL PRAJAPATI - avatar
0
tnxd gays
17th Jun 2016, 11:47 AM
amin doreh
amin doreh - avatar