Creating function

This is a discussion on Creating function within the C Programming forums, part of the General Programming Boards category; Hi, I want to know if there a way to create a C function on the run-time and then assign ...

  1. #1
    Unregistered
    Guest

    Question Creating function

    Hi,
    I want to know if there a way to create a C function on the run-time and then assign the function to a pointer so that it can be called later.



    Thanks.

  2. #2
    Im a Capricorn vsriharsha's Avatar
    Join Date
    Feb 2002
    Posts
    192

    Exclamation

    What exactly do u mean by a Creating a Function during RUN-TIME?? Sounds literally Strange. Can u elaborate your question. Just give me the situation which made u come out with this idea.
    Regards

  3. #3
    Unregistered
    Guest
    it doesn't sound too "Strange."
    Maybe you should embed a scripting engine into your program and then call functions from the script during the programs execution? try lua.

  4. #4
    Unregistered
    Guest

    Unhappy

    I've a system in-place already and the system will call other functions based on a list of function pointers. The system works fine if I've those functions implemented on the compilation time; since then I will have the list of function pointers.

    But, now we need to extend this system to allow user dynamically create "some scripts". Then we need to link each script to the system so that the system still exec those 'scripts".

    That's why I need a way of somehow to create a "Stub" function on the run-time and do the binding with one side to the System and other side to the scripts.

  5. #5
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    So your system should call scripts that the user can add at runtime? Then you need to write a parser to interpret the scripts.

  6. #6
    Unregistered
    Guest
    We already have the parser for other project and we are going to use it.
    Then, we need to add this binding cap to the parser for our project.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Needs help in Dev-C++
    By Korrupt Lawz in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2010, 02:17 AM
  2. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 09:18 PM
  3. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 11:03 AM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21