Thread: How to use c programming to declaire a new function it self ?

  1. #1
    Unregistered
    Guest

    How to use c programming to declaire a new function it self ?

    I mean in the menage part ..............
    i can add or delete declaired function in a funning c program ?


    Something like this
    " 1 add new function"
    points

    "the data type ?
    1 int
    2 float
    3 char "

    then it will create a new functions it self

    is it posible ?

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    Well... techincally, yes, if you were to throw a bit of assembly in, but really it's not gonna happen. Once you've compiled your code, that's pretty much it, no changing from there.

    It would be possible however, to write a program that would act like it was handling functions (also not an easy task...)
    Callou collei we'll code the way
    Of prime numbers and pings!

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    375
    You might check out .DLLs (dynamic link libs) and scripting languages/engines.
    Allegro precompiled Installer for Dev-C++, MSVC, and Borland: http://galileo.spaceports.com/~springs/

  4. #4
    Sayeh
    Guest
    No. technically you can do this. But 'self-modifying-code' is no longer allowed in programs. This is primarily because of the processor cache. If it loads code in and then it gets modified by the application, but doesn't match in the cache... it causes massive cache hits.

    You are also completely ignoring the jump/link table aspect. You would have to relink a portion of your code on the fly.

    I have done that... It is possible that I am the only one on this board that has actually done so. I can think of only approximately 5 other people on this board that might even know enough to do this.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  4. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  5. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM