Thread: Eval() in C?
View Single Post
  #4   Spotlight this post!  
Unread 06-01-2008, 23:42
Danny Diaz's Avatar
Danny Diaz Danny Diaz is offline
Smooth Operator
AKA: FrankenMentor
None #0418
Team Role: Alumni
 
Join Date: Apr 2005
Rookie Year: 2003
Location: Manchester, NH
Posts: 545
Danny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond reputeDanny Diaz has a reputation beyond repute
Send a message via AIM to Danny Diaz
Re: Eval() in C?

Quote:
Originally Posted by CapnKernel View Post
I basically want to be able to store a string in a struct and then be able to call that method when "the time is right."
Actually, what you're probably looking for is a "function pointer". Structs can store a pointer to a function call that you assign somewhere programmatically in code, and then when you want to call that function you just dereference the pointer (in a specific way). Check it out: http://www.newty.de/fpt/index.html

-Danny
__________________
Danny Diaz
Former Lead Technical Mentor, FRC 418