Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What does this C language statement mean?

int (*EVP_MD_meth_get_cleanup(const EVP_MD *md))(EVP_MD_CTX *ctx)

I find this code piece, not sure how to understand it. I think EVP_MD_meth_get_cleanup is the name of the function pointer type, return int, but not understand the argument part.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

EVP_MD_meth_get_cleanup is a function, that takes const EVP_MD *md as an argument, and returns a function pointer. That function pointer takes EVP_MD_CTX *ctx and returns an int.

Nothing better than an example:

int somefunction(EVP_MD_CTX *ctx) {
    stuff();
}

int (*EVP_MD_meth_get_cleanup(const EVP_MD *md))(EVP_MD_CTX *ctx) {
   return somefunction;
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading