c - function calling of a structure error -
I am currently having trouble understanding the fault of a certain part of the code that includes the use of a function Structure of structure and structure B
RectT a, b, recs [50]; Int acount, bcount; .... .... / * checks whether chk_overlap returns function 1, if it is 1 to bcount and acount * / if (chk_overlap (recs, a) == 1) {bcount ++; } If (chk_overlap (RECS, B) == 1) {acount ++; }
The function is being called
int chk_overlap (RectT * r1, RectT * r2) {}
And the structure is
Type-Effect Structure Rect {int x; Int y; Int w; Int h; } RectT;
code inside because it is a homework assignment
The current error is telling that IM is getting
GCC - Wal-g-lion-o xtst rec02.c rec02.c: Function in 'main': rec02.c: 64: Error: Inconsistent type for logic 2 of 'chk_overlap' rec02.c: 69: Error: Logic Inaccurate type 2 for 'chk_overlap'
chk_overlap ()
two accepts rectit * *
, you can call it as
If (chk_overlap (recs, & amp; a == 1)
note & amp; / code> operator that finds
a
.
Comments
Post a Comment