Dynamically creating functions in C

前端 未结 10 1632
-上瘾入骨i
-上瘾入骨i 2020-12-09 10:52

How can I dynamically create a function in C?

I try to summarize my C problem as follows:

  • I have a matrix and I want to be able to use some function

10条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 11:11

    One way of doing would be to write a standard C file with the set of functions you want, compile it via gcc and the load it as a dynamic library to get pointers to the functions.

    Ultimately, it probably would be better if you were able to specify your functions without having to define them on-the-fly (like via having a generic template function that takes arguments that define its specific behavior).

提交回复
热议问题