vectorMainColorVec (RegionNum vector (0));//RegionNum has calculated
Then, the array in the function call:
Segment IMG.//defines a Segment the object of the class
IMG. GetRegionMainColorVecs (RegionNum LabelVec, AreaVec, 8, MainColorVec, MainColorFreqVec, MainColorNumVec);
Among them, the member function declaration is as follows:
class Segment
{
Private:
.//a member variable
Public:
.//a member function
Void GetRegionMainColorVecs (int RegionNums, int * LabelVec, int * AreaVec, const int binNums, vectorMainColorVec, float * MainColorFreqVec, int * MainColorNumVec);
}
The problems is the 2 d array MainColorVec calculation results without passing out , specific as follows:
Call a function within:
After the jump function:
Consult everybody ~ ~ great god what causes
CodePudding user response:
Parameter is changed to a reference typevoid GetRegionMainColorVecs (int RegionNums, int * LabelVec, int * AreaVec, const int binNums, vector& MainColorVec, float * MainColorFreqVec, int * MainColorNumVec);
CodePudding user response: