C++ struct to Java class -
I want to convert such a c ++ struct: and I will use it: In the Java code I wrote my code: and test a simple code worte what I success: I'm a beginner Java, please help me thank you very much! Much more! My error is: Thank you again !!!!! = D
typedef struct FEATUREINFO {String str_ID; Four * CIID; Double * FeatureData; Int group; Bull beprint; IplImage * t_faceImg; } FEATUREINFO;
FEATUREINFO * p_featureNode = new FEATUREINFO [100]; (; J & lt; 100; Int J = 0 {p_featureNode for J ++) [J] .featureData = (double *) calloc (t_featureLen, sizeof (double)); P_featureNode [j] .bPrint = false; }
class FEATUREINFO {string str_ID; Four [] ciid; Public double [] featuredata; Int group; Public Boolean Biprint; // IplImage * t_faceImg; Public FEATUREINFO () {this.featureData = New Double [1280]; }} // class FEATUREINFO
FEATUREINFO [] p_featureNode = new FEATUREINFO [100 ]; P_featureNode [5] .featureData [2] = 100.5; // This line will be error !!! = (Log.d (Tag_Test, "featureData:" + p_featureNode [5] .featureData [2]);
C ++ each array element (each array element to a default position Initializer calling for) initializes
FEATUREINFO [] p_featureNode = initializeWithDefaultFEATUREINFOInstances (100); ... public place Su FEATUREINFO [] initializeWithDefaultFEATUREINFOInstances (int length) {FEATUREINFO [] array = new FEATUREINFO [length] to: (i Int = 0; i & lt; length; i ++) {array [i] = new FEATUREINFO () ;} Return Array;}
Comments
Post a Comment