Home > Back-end >  C structure compilation errors and drawing library function problem
C structure compilation errors and drawing library function problem

Time:09-23

In vc6, I in the graph. H, defines the structure of the ray in. CPP wrote in the following two methods, compile time, however, suggests that thunder is not defined, how is this to return a responsibility excuse me? My other structures are not an error,

. Also, I use a graphics library function circle of h (int, int, int) circle, but compile-time hint parameter error, thank you for the great god

C: \ Program Files \ Microsoft Visual Studio \ MyProjects \ colorfulRain \ colorfulRain CPP (19) : error C2872: 'circle' : ambiguous symbol
C: \ Program Files \ Microsoft Visual Studio \ MyProjects \ colorfulRain \ colorfulRain CPP (19) : error C2661: 'circle: : circle: no overloaded function takes three parameters

C: \ Program Files \ Microsoft Visual Studio \ MyProjects \ colorfulRain \ colorfulRain CPP (109) : error C2027: the use of undefined type 'thunder'

Struct thunder {//ray
Int the X1;//coordinates 1
Int Y1.//coordinates 1
Int X2.//coordinates 2
Int Y2.//coordinates 2
Int the X3.//coordinates of 3
Int Y3.//coordinates of 3
Int X4;//coordinates 4
Int Y4.//coordinates 4
Struct thunder * next;//the next ray
};

H # graphics.
Struct thunder * makethunder () {
Struct thunder * p;
P=(struct thunder *) malloc (sizeof (struct thunder));
P - & gt; X1=random (640);
P - & gt; Y1=random (300);
P - & gt; X2=p - & gt; X1 - random (20);
P - & gt; Y2=p - & gt; Y1 + random (20);
P - & gt; The X3=p - & gt; X2 + random (20);
P - & gt; Y3=p - & gt; Y2 + random (15);
P - & gt; X4=p - & gt; The X3 - random (20);
P - & gt; Y4=p - & gt; Y3 + random (30);
}

Void drawthunder (struct thunder * p) {
Setcolor (WHITE);
The line (p - & gt; X1, p - & gt; Y1, p - & gt; X2, p - & gt; Y2);
The line (p - & gt; X2, p - & gt; Y2, p - & gt; The X3, p - & gt; Y3);
The line (p - & gt; The X3, p - & gt; Y3, p - & gt; X4, p - & gt; Y4);
}

CodePudding user response:

Graphics. H is third-party libraries?
  • Related