Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int task5(){
- Point pointOne(1,4);
- Point pointTwo(5,3);
- Point pointThree(2,2);
- TextWindow tW;
- Point testPoints[3]={pointOne, pointTwo, pointThree};
- Point resultPoint = averagePoint(testPoints, 3);
- printPoint(tW, resultPoint);
- return 0;
- }
- Point averagePoint(Point points[], int length){
- double resultX;
- double resultY;
- double x;
- double y;
- for(int i=0; i <= length; i++){
- resultX+= (points[i]).getX;
- resultY+= (points[i]).getY;
- }
- x = resultX/length;
- y = resultY/length;
- Point middlePoint(x,y);
- return middlePoint;
- }
- F:\SkolaDMP\objektOrienteradMjukvaruUtveckling\labb1\labb001\main.cpp:72: error: could not convert '(ShapeLib::Point*)(& testPoints)' from 'ShapeLib::Point*' to 'ShapeLib::Point'
- Point resultPoint = averagePoint(testPoints, 3);
- ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement