Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. int task5(){
  2. Point pointOne(1,4);
  3. Point pointTwo(5,3);
  4. Point pointThree(2,2);
  5. TextWindow tW;
  6. Point testPoints[3]={pointOne, pointTwo, pointThree};
  7. Point resultPoint = averagePoint(testPoints, 3);
  8. printPoint(tW, resultPoint);
  9. return 0;
  10. }
  11.  
  12. Point averagePoint(Point points[], int length){
  13. double resultX;
  14. double resultY;
  15. double x;
  16. double y;
  17. for(int i=0; i <= length; i++){
  18. resultX+= (points[i]).getX;
  19. resultY+= (points[i]).getY;
  20.  
  21. }
  22. x = resultX/length;
  23. y = resultY/length;
  24.  
  25. Point middlePoint(x,y);
  26. return middlePoint;
  27.  
  28. }
  29.  
  30. F:\SkolaDMP\objektOrienteradMjukvaruUtveckling\labb1\labb001\main.cpp:72: error: could not convert '(ShapeLib::Point*)(& testPoints)' from 'ShapeLib::Point*' to 'ShapeLib::Point'
  31. Point resultPoint = averagePoint(testPoints, 3);
  32. ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement