Ask Your Question
1

Function declared without variable name in examples

asked 2018-02-16 06:55:08 -0600

Crapsy gravatar image

Hello, I'm looking at some example provided by OpenCV and I see a recurrent typo that I don't fully understand. For instance, the erosion function in "Eroding and Dilating" example is declared:

void Erosion( int, void* );

Why do they use int and void* without variable name? And to what variable does it refer?

Thank you in advance

edit retag flag offensive close merge delete

Comments

supra56 gravatar imagesupra56 ( 2018-02-16 20:12:29 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-02-16 07:08:46 -0600

berak gravatar image

it is a callback function for trackbars , its parameters are the trackbar value, and a pointer to some user supplied data.

in the example, those arguments are never used, so their names are omitted, to avoid an "unused argument" warning.

edit flag offensive delete link more

Comments

1

Thank you, I couldn't expect a better answer.

Crapsy gravatar imageCrapsy ( 2018-02-16 07:26:05 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-02-16 06:54:25 -0600

Seen: 177 times

Last updated: Feb 16 '18