S
S
Sergey Karbivnichy2022-02-20 19:33:23
C++ / C#
Sergey Karbivnichy, 2022-02-20 19:33:23

What does this line mean in C/C++?

double (*func)(double x);- this variable stores the address of the function loaded from the *.so library. For me, such designs are still complicated. I guess this is an abbreviated record (probably). If so, what would the full record look like.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2022-02-20
@hottabxp

No, that's the full notation, a variable called func that holds a pointer to a function that takes a double and returns a double.
Read in a spiral: https://habr.com/en/post/100104/
If possible, it's better to use std::function - it's more readable
https://en.cppreference.com/w/cpp/utility/function.. .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question