class Point{
private:
float x , y;
public:
Point( float a , float b ): x (a) , y (b){}
};
对象数组 作形式参数
float lineFit ( const Point points [] , int nPoint )
主函数中的初始化
int main (){
Point p[6] = { Point ( 1 , 3 ) , Point ( 2 , 4 ) , Point ( 4 , 5 ) , Point ( 6 , 8 ) , Point ( 9 , 12 ) , Point ( 8 , 13 ) }
return 0;
}
浙公网安备 33010602011771号