C++ - pointer value -


in learning opencv book:

. . cvcapture *capture = cvcreatefilecapture(argv[1]); iplimage* frame; while(1) { frame = cvqueryframe(capture); . . } 

here, can see *frame pointer. but, when write following frame = cvqueryframe(capture);, not assigning address pointer. values frame hold in case?

thanks.

frame pointer object of type iplimage. presumably, cvqueryframe() function allocates iplimage object , returns address of object. statement

frame = cvqueryframe(capture); 

assigns value of returned pointer frame. if indeed function allocating new object you'll required free memory later calling operator delete or function

void cvdestroyframe( iplimage * ); 

also statement make @ end of question ("*frame pointer") not accurate - frame pointer; *frame means you're de-referencing pointer makes type iplimage.


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -