* question

So I know *a is "pointed to by a" and int * a means a's type is a pointer to a int value.

So I came across this:

1
2
3
4
5
6
7
8
9
10
11
12
DLLIMPORT int lv_FeatureEvaluator_create(int type, THEINT * err)
{
try {  
		Ptr<FeatureEvaluator> *FeatureE=new Ptr<FeatureEvaluator>;
		*FeatureE=FeatureEvaluator::create( type ); 

		return (THEINT)FeatureE;
		
	} 
catch (cv::Exception& e) 		  { Exception *d = new Exception(); *d = e; *err = (THEINT)(d); }
			
 }


Had some trouble understanding what this part does. Does it create something thats pointed to by feature? If so, what will its name be (will it have one or be accessible only by this pointer?) so will the return part give back the pointer Freature?

Might be a simple answer but i got stuck on a few questions like this one. An explanation could help a lot so again, thanks in advance.
Last edited on
Ptr<FeatureEvaluator> * FeatureE
Here FeatureE is a pointer to type Ptr<FeatureEvaluator>/
Ptr is a templated class and FeatureEvaluator is a template argument (just like vector<int>)

Second part of expression: new Ptr<FeatureEvaluator>; creates new object of type Ptr<FeatureEvaluator>

So you are declaring a pointer to the Ptr<FeatureEvaluator> and initialize it with a new object of corresponding type
that helped thanks
Topic archived. No new replies allowed.