Hey Brett, 

thank you for you answer. Could you please elaborate on it? I am not 
familiar with sprintf().

Thanks a lot!





--- In [email protected], "Brett W. McCoy" <[EMAIL PROTECTED]> 
wrote:
>
> On 3/29/07, sanofsans <[EMAIL PROTECTED]> wrote:
> 
> > I have this simple c program that invokes a perl program.
> >
> > #include <stdio.h>
> >
> >
> > void main()
> > {
> > system("perl perl1.pl");
> > return;
> > }
> >
> >
> > Now, perl1 should be a char varible that changes according to the
> > user's choice.
> > My question is now, how do you pass a variable to the command:
> >
> > system("perl variable.pl");
> >
> > Any help is greatly appreciated!
> 
> Use sprintf() to build your command string and pass that into the
> system() function.
> 
> -- Brett
> ------------------------------------------------------------
> "In the rhythm of music a secret is hidden;
>     If I were to divulge it, it would overturn the world."
>                -- Jelaleddin Rumi
>


Reply via email to