Using a library function
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Using a library function

Hybrid View

  1. #1
    Join Date
    Jan 2002
    Location
    NJ
    Posts
    3

    Using a library function

    I have been trying to find a way around the following:
    I am using a library functor to solve the root of a non linear equation. It passes two doubles and the name of a function that contains the equation to be solved.

    Its xtor and operator are

    RootFind(double tL,double tR,double (*fn)(double t));

    void operator()(double tL,doubleR,double (*fn)(double t));

    I want to be able to send another variable to function fn; I don't know what the value of the variable will be ahead of time.
    How do I get the library functor to take an extra variable in the function passed?

    Thanks,
    T.

  2. #2
    Join Date
    Apr 1999
    Posts
    27,418

    Re: Using a library function

    Quote Originally Posted by azeotrope View Post
    I want to be able to send another variable to function fn;
    If the function takes one argument, then you need to change it or add another set of functions to handle 2 arguments. There is no way around it.

    Regards,

    Paul McKenzie

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center