Sunday, 8 September 2013

How to call a function in a pre-compiled executable file in C++ (calling by command)?

How to call a function in a pre-compiled executable file in C++ (calling
by command)?

I'm trying to write this program in C++ where I am required to call a
function "by the command" from an executable that is pre-compiled. for
example. I have compiled my source files giving me the .o files for them.
How do I call a function from a .o file that I haven't written or
compiled? I've heard of system but it doesn't seem like I'm using it the
right way is I am getting wrong results.
What I am attempting looks something like this:
int x, y, a, b, c;
i = system("foo.o foo(y, a, b, c)");
Where foo.o should only have the function that should produce the result I
want.
Thank you.

No comments:

Post a Comment