Is it possible to call a function during execution?

This is a discussion on Is it possible to call a function during execution? within the C Programming forums, part of the General Programming Boards category; I want to write a function and be able to call it during execution (say during a while(1) loop). Is ...

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    71

    Is it possible to call a function during execution?

    I want to write a function and be able to call it during execution (say during a while(1) loop). Is this possible without having to parse an input string to extract the function and parameters I need or is that the only way?

    Thanks!.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,548
    No, C does not have it's own built-in 'eval' function, where you can type in arbitrary bits of code which is then compiled and run.

    I suppose you could integrate this into your program, if you want some scripting ability.
    Lua: about
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function execution time
    By DeanWinchester in forum C Programming
    Replies: 5
    Last Post: 01-08-2012, 01:26 PM
  2. Function execution question
    By raczzoli in forum C Programming
    Replies: 4
    Last Post: 07-02-2011, 04:36 PM
  3. Scheduling a program/function execution?
    By Aedile in forum Linux Programming
    Replies: 1
    Last Post: 08-12-2005, 10:19 AM
  4. dynamic function execution
    By Sargnagel in forum C Programming
    Replies: 7
    Last Post: 05-07-2003, 05:28 AM
  5. randomizing order of execution of function
    By y2jasontario in forum C Programming
    Replies: 2
    Last Post: 04-03-2002, 06:50 PM

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