sonet wrote:
(fx:foreshadowing "important question")
Many Language have eval function.The C have eval function?
Standard C has no built-in `eval` function.
How to execute c code in c ?
You'd have to do it in a non-portable way, such as using `system`
to run the C compiler, generate a loadable library, and then
system magic to load and execute that library. (fx:mumble)
POSIX, comp.unix.programmer.
Can i execute c code from a variable(like perl's code ref)?
No.
Or i must do this job by using yacc & lex ?
That would mean writing a C compiler. That's a lot of hard
work. Don't go there. (Someone else might have gone there,
or somewhere like it.)
All of the non-interpreted languages have no eval function?
There are compiled languages with an eval function; Common Lisp and
Poplog's Pop11, to name two.
(Depending on exactly what you mean by `compiled`. The Pop11 compiler
compiles on-the-fly to native code. So does at least one Common
Lisp.)
Important Question: /why do you want to know/? Is it mere curiosity,
or do you have an actual problem you want to solve? In that case,
telling us about that problem might get you a more useful answer.
--
"Go not to the Elves for counsel, for they will answer both no and yes."/tLotR/
Hewlett-Packard Limited registered no:
registered office: Cain Road, Bracknell, Berks RG12 1HN 690597 England