 |
Linux Format forums Help, discussion, magazine feedback and more
|
| View previous topic :: View next topic |
| Author |
Message |
fuchi
Joined: Mon Sep 19, 2005 1:44 am Posts: 1
|
Posted: Mon Sep 19, 2005 1:57 am Post subject: How to generate a file which contains the def. of a funct. |
|
|
In the file makeFoo2.c I have a main function that prints the code that will end up in the file
foo2.c. The function foo2() prompts for who you want to say 'Hello' to, reads the string from stdin and returns that string.
The file foo2.c , which contains the defintion of the function foo2() needs to be generated by an invocation of makeFoo2.c file.
I am not sure how to do this all.
If any ideas, please help.
Thanks |
|
| Back to top |
|
 |
jjmac LXF regular
Joined: Fri Apr 08, 2005 2:32 am Posts: 1996 Location: Sydney, Australia
|
Posted: Mon Sep 19, 2005 2:56 am Post subject: RE: How to generate a file which contains the def. of a func |
|
|
Would that be ...
| Code: |
#include <stdlib.h>
int system (const char * string);
system() executes a command specified in string by calling /bin/sh
-c string, and returns after the command has been completed. During
execution of the command, SIGCHLD will be blocked, and SIGINT and
SIGQUIT will be ignored.
|
You could possibly just echo it to the file ... there must be a better way though (grin)
jm _________________ http://counter.li.org
#313537
The FVWM wm -=- www.fvwm.org -=-
Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ... |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|