Nilesh Chakraborty wrote:
> Hi,
>
> Suppose there is a text file containing this:
>
> int x = 10;
> printf("Value of x is %d\n",x);
>
> I need to write a C program which will open this .txt file and execute
> the C statements in it. Is this at all possible? If so, how? Or is
> there any alternative? Can I do the same by reading assembly
> instructions and execute them by using inline assembly?
You would need an embedded C interpreter to do what you want. I'm not
aware of any open source/free embeddable C interpreters. If you need to
run user-written code, you may be better off looking at embedding a
scripting language interpreter (Perl, Python, PHP, etc.) into your app.
versus a language that is typically compiled before being run.
--
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197
*NEW* MyTaskFocus 1.1
Get on task. Stay on task.
http://www.CubicleSoft.com/MyTaskFocus/