Passing a struct with multiple entries in c++
问题 I am trying to pass a coordinate, which is defined as struct with 2 integer parameters (the struct is called coord) the following way: UpdateB({0,0}); where the input argument is of type coord (i.e. in the above statement I am trying to pass a coordinate 0,0 ). UpdateB is some function. I am getting an error, any ideas what the problem could be? 回答1: Make a constructor accepting two argumnets. Pass it as follows: MyFunc(Point2d(0,0)); 回答2: Pavel's got it spot on. If you want to create the